protected override void UpdateEntity(UpdateGameDto updateItemDto, GameBase entity) { GameDetailsDto details = updateItemDto.GameDetails; entity.GameDetails.UpdateGameDetails(details.Name, details.Price, details.Description, details.ReleaseDate, details.AgeRestrictionSystem); entity.Update(updateItemDto.GenreId, updateItemDto.DeveloperStudioId, updateItemDto.PublisherId); }
protected override GameBase MapEntity(AddGameDto addItemDto) { GameDetailsDto details = addItemDto.GameDetails; GameDetails dbGameDetails = new GameDetails(details.Name, details.Price, details.Description, details.ReleaseDate, details.AgeRestrictionSystem); GameBase game = new GameBase(addItemDto.GenreId, addItemDto.DeveloperStudioId, addItemDto.PublisherId, dbGameDetails); game.AddAttachments(addItemDto.Attachments.Select(t => new GameAttachment(t.Type, t.LinkUri, t.Description)).ToList()); return(game); }