Exemplo n.º 1
0
 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"));
 }
Exemplo n.º 3
0
 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"));
 }