public void Alterar(GameDataView dados) { dadosGame = dados; game = db.game.Find(dadosGame.Id); loja = new StoreRepository(); developerPublisher = new DeveloperPublisherRepository(); genre = new GenreRepository(); SetDadosgame(); db.Entry(game).State = EntityState.Modified; SetPlataformasGame(); RemovePlataformasGame(); AtualizarWishlist(); SetDevelopersGame(); RemoveDevelopersGame(); SetPublishersGame(); RemovePublishersGame(); SetGenresGame(); RemoveGenresGame(); db.SaveChanges(); SaveImagemGame(); }
public void Adicionar(GameDataView dados) { dadosGame = dados; game = new GameEntity(); loja = new StoreRepository(); developerPublisher = new DeveloperPublisherRepository(); genre = new GenreRepository(); SetDadosgame(); db.game.Add(game); SetPlataformasGame(); AtualizarWishlist(); SetDevelopersGame(); SetPublishersGame(); SetGenresGame(); db.SaveChanges(); SaveImagemGame(); }