|
|
|
@ -103,6 +103,16 @@ namespace Dto2Entities
|
|
|
|
|
return question;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<QuestionDTO> ToDto(this List<Question> item)
|
|
|
|
|
{
|
|
|
|
|
List<QuestionDTO> questionDTOs = new List<QuestionDTO>();
|
|
|
|
|
foreach (Question question in item)
|
|
|
|
|
{
|
|
|
|
|
questionDTOs.Add(question.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return questionDTOs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static QuizDTO ToDto(this Quiz item)
|
|
|
|
|
{
|
|
|
|
|
QuizDTO quiz = new QuizDTO();
|
|
|
|
@ -113,6 +123,16 @@ namespace Dto2Entities
|
|
|
|
|
return quiz;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<QuizDTO> ToDto(this List<Quiz> item)
|
|
|
|
|
{
|
|
|
|
|
List<QuizDTO> quizDTOs = new List<QuizDTO>();
|
|
|
|
|
foreach (Quiz quiz in item)
|
|
|
|
|
{
|
|
|
|
|
quizDTOs.Add(quiz.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return quizDTOs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Surement a refaire car QuizQuestion Entity modifier sur branche EF
|
|
|
|
|
public static QuizQuestionDTO ToDto(this QuizQuestion item)
|
|
|
|
|
{
|
|
|
|
@ -122,6 +142,16 @@ namespace Dto2Entities
|
|
|
|
|
return quizQuestion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<QuizQuestionDTO> ToDto(this List<QuizQuestion> item)
|
|
|
|
|
{
|
|
|
|
|
List<QuizQuestionDTO> quizQuestionDTOs = new List<QuizQuestionDTO>();
|
|
|
|
|
foreach (QuizQuestion quizQuestion in item)
|
|
|
|
|
{
|
|
|
|
|
quizQuestionDTOs.Add(quizQuestion.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return quizQuestionDTOs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static QuoteDTO ToDto(this Quote item)
|
|
|
|
|
{
|
|
|
|
|
QuoteDTO quote = new QuoteDTO();
|
|
|
|
@ -137,6 +167,16 @@ namespace Dto2Entities
|
|
|
|
|
return quote;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<QuoteDTO> ToDto(this List<Quote> item)
|
|
|
|
|
{
|
|
|
|
|
List<QuoteDTO> quoteDTOs = new List<QuoteDTO>();
|
|
|
|
|
foreach (Quote quote in item)
|
|
|
|
|
{
|
|
|
|
|
quoteDTOs.Add(quote.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return quoteDTOs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static SourceDTO ToDto(this Source item)
|
|
|
|
|
{
|
|
|
|
|
SourceDTO source = new SourceDTO();
|
|
|
|
@ -147,6 +187,16 @@ namespace Dto2Entities
|
|
|
|
|
return source;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<SourceDTO> ToDto(this List<Source> item)
|
|
|
|
|
{
|
|
|
|
|
List<SourceDTO> sourceDTOs = new List<SourceDTO>();
|
|
|
|
|
foreach (Source source in item)
|
|
|
|
|
{
|
|
|
|
|
sourceDTOs.Add(source.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return sourceDTOs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static UserDTO ToDto(this Users item)
|
|
|
|
|
{
|
|
|
|
|
UserDTO user = new UserDTO();
|
|
|
|
@ -159,14 +209,14 @@ namespace Dto2Entities
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<UserDTO> ToDto(this List<Users> users)
|
|
|
|
|
public static List<UserDTO> ToDto(this List<Users> item)
|
|
|
|
|
{
|
|
|
|
|
List<UserDTO> userDTOs = new List<UserDTO>();
|
|
|
|
|
foreach (Users user in users)
|
|
|
|
|
List<UserDTO> users = new List<UserDTO>();
|
|
|
|
|
foreach (Users user in item)
|
|
|
|
|
{
|
|
|
|
|
userDTOs.Add(ToDto(user));
|
|
|
|
|
users.Add(user.ToDto());
|
|
|
|
|
}
|
|
|
|
|
return userDTOs;
|
|
|
|
|
return users;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static TypeLangageDTO ToDto(this LangEnum item)
|
|
|
|
@ -204,6 +254,16 @@ namespace Dto2Entities
|
|
|
|
|
return character;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Character> ToEntity(this List<CharacterDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Character> characters = new List<Character>();
|
|
|
|
|
foreach (CharacterDTO character in item)
|
|
|
|
|
{
|
|
|
|
|
characters.Add(character.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return characters;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Commentary ToEntity(this CommentaryDTO item)
|
|
|
|
|
{
|
|
|
|
|
Commentary commentary = new Commentary();
|
|
|
|
@ -215,6 +275,16 @@ namespace Dto2Entities
|
|
|
|
|
return commentary;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Commentary> ToEntity(this List<CommentaryDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Commentary> commentarys = new List<Commentary>();
|
|
|
|
|
foreach (CommentaryDTO commentary in item)
|
|
|
|
|
{
|
|
|
|
|
commentarys.Add(commentary.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return commentarys;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Surement a refaire car Faoirite Entity modifier sur branche EF
|
|
|
|
|
public static Favorite ToEntity(this FavoriteDTO item)
|
|
|
|
|
{
|
|
|
|
@ -224,6 +294,16 @@ namespace Dto2Entities
|
|
|
|
|
return favorite;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Favorite> ToEntity(this List<FavoriteDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Favorite> favorites = new List<Favorite>();
|
|
|
|
|
foreach (FavoriteDTO favorite in item)
|
|
|
|
|
{
|
|
|
|
|
favorites.Add(favorite.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return favorites;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Images ToEntity(this ImageDTO item)
|
|
|
|
|
{
|
|
|
|
|
Images image = new Images();
|
|
|
|
@ -232,6 +312,16 @@ namespace Dto2Entities
|
|
|
|
|
return image;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Images> ToEntity(this List<ImageDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Images> images = new List<Images>();
|
|
|
|
|
foreach (ImageDTO image in item)
|
|
|
|
|
{
|
|
|
|
|
images.Add(image.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return images;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Question ToEntity(this QuestionDTO item)
|
|
|
|
|
{
|
|
|
|
|
Question question = new Question();
|
|
|
|
@ -244,6 +334,15 @@ namespace Dto2Entities
|
|
|
|
|
question.CorrectAnswer = item.CorrectAnswer;
|
|
|
|
|
return question;
|
|
|
|
|
}
|
|
|
|
|
public static List<Question> ToEntity(this List<QuestionDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Question> questions = new List<Question>();
|
|
|
|
|
foreach (QuestionDTO question in item)
|
|
|
|
|
{
|
|
|
|
|
questions.Add(question.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return questions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Quiz ToEntity(this QuizDTO item)
|
|
|
|
|
{
|
|
|
|
@ -255,6 +354,16 @@ namespace Dto2Entities
|
|
|
|
|
return quiz;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Quiz> ToEntity(this List<QuizDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Quiz> quizs = new List<Quiz>();
|
|
|
|
|
foreach (QuizDTO quiz in item)
|
|
|
|
|
{
|
|
|
|
|
quizs.Add(quiz.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return quizs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Surement a refaire car QuizQuestion Entity modifier sur branche EF
|
|
|
|
|
public static QuizQuestion ToEntity(this QuizQuestionDTO item)
|
|
|
|
|
{
|
|
|
|
@ -264,6 +373,16 @@ namespace Dto2Entities
|
|
|
|
|
return quizQuestion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<QuizQuestion> ToEntity(this List<QuizQuestionDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<QuizQuestion> quizQuestions = new List<QuizQuestion>();
|
|
|
|
|
foreach (QuizQuestionDTO quizQuestion in item)
|
|
|
|
|
{
|
|
|
|
|
quizQuestions.Add(quizQuestion.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return quizQuestions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Quote ToEntity(this QuoteDTO item)
|
|
|
|
|
{
|
|
|
|
|
Quote quote = new Quote();
|
|
|
|
@ -279,6 +398,16 @@ namespace Dto2Entities
|
|
|
|
|
return quote;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Quote> ToEntity(this List<QuoteDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Quote> quotes = new List<Quote>();
|
|
|
|
|
foreach (QuoteDTO quote in item)
|
|
|
|
|
{
|
|
|
|
|
quotes.Add(quote.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return quotes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Source ToEntity(this SourceDTO item)
|
|
|
|
|
{
|
|
|
|
|
Source source = new Source();
|
|
|
|
@ -289,6 +418,16 @@ namespace Dto2Entities
|
|
|
|
|
return source;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Source> ToEntity(this List<SourceDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Source> sources = new List<Source>();
|
|
|
|
|
foreach (SourceDTO source in item)
|
|
|
|
|
{
|
|
|
|
|
sources.Add(source.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return sources;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static Users ToEntity(this UserDTO item)
|
|
|
|
|
{
|
|
|
|
|
Users user = new Users();
|
|
|
|
@ -301,6 +440,16 @@ namespace Dto2Entities
|
|
|
|
|
return user;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<Users> ToEntity(this List<UserDTO> item)
|
|
|
|
|
{
|
|
|
|
|
List<Users> users = new List<Users>();
|
|
|
|
|
foreach (UserDTO user in item)
|
|
|
|
|
{
|
|
|
|
|
users.Add(user.ToEntity());
|
|
|
|
|
}
|
|
|
|
|
return users;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static LangEnum ToEntity(this TypeLangageDTO item)
|
|
|
|
|
{
|
|
|
|
|
switch (item)
|
|
|
|
|