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