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 })); }
public ActionResult <Imovel> Get(int id) { return(Ok(new { status = "200", msg = "OK", obj = repository.GetByID(id) })); }
public RedirectToActionResult Create(ContaLuz entity) { entity.imovel = imovelRepository.GetByID(entity.imovel.id); contaLuzRepository.Create(entity); return(RedirectToAction("Index")); }
public IActionResult View(int id) { return(View(imovelRepository.GetByID(id))); }