public void Update(ContaRestaurante nome) { context.Entry(nome).State = EntityState.Modified; context.SaveChanges(); }
public RedirectToActionResult Update(ContaRestaurante entity) { entity.restaurante = restauranteRepository.GetByID(entity.restaurante.id); contaRestauranteRepository.Update(entity); return(RedirectToAction("Index")); }
public void Create(ContaRestaurante nome) { context.Entry(nome).State = EntityState.Added; context.SaveChanges(); }
public RedirectToActionResult Create(ContaRestaurante entity) { //resolver problema na entidade restaurante entity.restaurante = restauranteRepository.GetByID(entity.restaurante.id); contaRestauranteRepository.Create(entity); return(RedirectToAction("Index")); }