public static PhotoEntityModel MapPhotoEntityModel(Photo photo) { return(new PhotoEntityModel { PhotoId = photo.PhotoID, PhotoName = photo.PhotoName, Comment = PhotoModelMapper.MapCommentsEntityModel(photo.PhotoComment), //AlbumID=photo.AlbumID }); }
public static AlbumEntityModel MapAlbumEntityModel(Album album) { return(new AlbumEntityModel { AlbumId = album.AlbumID, AlbumName = album.AlbumName, Comment = album.AlbumComment.Select(x => CommentsModelMapper.EntityToModel(x)).ToList(), Photo = album.Photos.Select(x => PhotoModelMapper.EntityToModel(x)).ToList() }); }