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