Debut rajoue ToDto / ToEntity avec des list

pull/6/head
kekentin 3 weeks ago
parent 0aeb05fa88
commit aa8cb64d6f

@ -22,6 +22,16 @@ namespace Dto2Entities
return character; return character;
} }
public static List<CharacterDTO> ToDto(this List<Character> item)
{
List<CharacterDTO> characterDTOs = new List<CharacterDTO>();
foreach (Character character in item)
{
characterDTOs.Add(character.ToDto());
}
return characterDTOs;
}
public static CommentaryDTO ToDto(this Commentary item) public static CommentaryDTO ToDto(this Commentary item)
{ {
CommentaryDTO commentary = new CommentaryDTO(); CommentaryDTO commentary = new CommentaryDTO();
@ -33,6 +43,16 @@ namespace Dto2Entities
return commentary; return commentary;
} }
public static List<CommentaryDTO> ToDto(this List<Commentary> item)
{
List<CommentaryDTO> commentaryDTOs = new List<CommentaryDTO>();
foreach (Commentary commentary in item)
{
commentaryDTOs.Add(commentary.ToDto());
}
return commentaryDTOs;
}
// Surement a refaire car Faoirite Entity modifier sur branche EF // Surement a refaire car Faoirite Entity modifier sur branche EF
public static FavoriteDTO ToDto(this Favorite item) public static FavoriteDTO ToDto(this Favorite item)
{ {
@ -42,6 +62,16 @@ namespace Dto2Entities
return favorite; return favorite;
} }
public static List<FavoriteDTO> ToDto(this List<Favorite> item)
{
List<FavoriteDTO> favoriteDTOs = new List<FavoriteDTO>();
foreach (Favorite favorite in item)
{
favoriteDTOs.Add(favorite.ToDto());
}
return favoriteDTOs;
}
public static ImageDTO ToDto(this Images item) public static ImageDTO ToDto(this Images item)
{ {
ImageDTO image = new ImageDTO(); ImageDTO image = new ImageDTO();
@ -50,6 +80,16 @@ namespace Dto2Entities
return image; return image;
} }
public static List<ImageDTO> ToDto(this List<Images> item)
{
List<ImageDTO> imageDTOs = new List<ImageDTO>();
foreach (Images images in item)
{
imageDTOs.Add(images.ToDto());
}
return imageDTOs;
}
public static QuestionDTO ToDto(this Question item) public static QuestionDTO ToDto(this Question item)
{ {
QuestionDTO question = new QuestionDTO(); QuestionDTO question = new QuestionDTO();

Loading…
Cancel
Save