Example #1
0
        public ActionResult Post([FromBody] Consumo entity)
        {
            repository.Create(entity);

            return(Ok(new
            {
                status = "200",
                msg = "OK",
                obj = entity
            }));
        }
        public ActionResult Post([FromBody] Consumo entity)
        {
            var restaurante = restauranteRepository.GetByID(entity.id);

            if (restaurante != null)
            {
                entity.restaurante = restaurante;
            }

            repository.Create(entity);

            return(Ok(new
            {
                status = "200",
                msg = "OK",
                obj = entity
            }));
        }
 public RedirectToActionResult Create(Consumo entity)
 {   //resolver problema na entidade restaurante
     entity.restaurante = restauranteRepository.GetByID(entity.restaurante.id);
     consumoRepository.Create(entity);
     return(RedirectToAction("Index"));
 }
Example #4
0
 public RedirectToActionResult Create(Consumo entity)
 {
     consumoRepository.Create(entity);
     return(RedirectToAction("Index"));
 }