public ActionResult Post([FromBody] ContaLuz entity)
        {
            var imovel = imovelRepository.GetByID(entity.idimovel);

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

            repository.Create(entity);

            return(Ok(new
            {
                status = "200",
                msg = "OK",
                obj = entity
            }));
        }
Пример #2
0
 public RedirectToActionResult Create(ContaLuz entity)
 {
     entity.imovel = imovelRepository.GetByID(entity.imovel.id);
     contaLuzRepository.Create(entity);
     return(RedirectToAction("Index"));
 }