Esempio n. 1
0
        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)
     }));
 }
Esempio n. 3
0
 public RedirectToActionResult Create(ContaLuz entity)
 {
     entity.imovel = imovelRepository.GetByID(entity.imovel.id);
     contaLuzRepository.Create(entity);
     return(RedirectToAction("Index"));
 }
Esempio n. 4
0
 public IActionResult View(int id)
 {
     return(View(imovelRepository.GetByID(id)));
 }