public static PhotoEntityModel MapPhotoEntityModel(Photo photo) { return(new PhotoEntityModel { PhotoId = photo.PhotoID, PhotoName = photo.PhotoName, Comment = PhotoModelMapping.MapCommentEntityModel(photo.PhotoComment) }); }
public static Photo MapPhotoModel(PhotoEntityModel photo) { return(new Photo { PhotoID = photo.PhotoId, PhotoName = photo.PhotoName, PhotoComment = PhotoModelMapping.MapCommentModel(photo.Comment), }); }
public static AlbumEntityModel MapAlbumEntityModel(Album album) { return(new AlbumEntityModel { AlbumId = album.AlbumID, AlbumName = album.AlbumName, Comment = album.AlbumComments.Select(x => CommentModelMapping.EntityToModel(x)).ToList(), Photo = album.Photos.Select(x => PhotoModelMapping.EntityToModel(x)).ToList() }); }