コード例 #1
0
 public ActionResult <Imovel> Get(int id)
 {
     return(Ok(new
     {
         status = "200",
         msg = "OK",
         obj = Repositories.GetByID(id)
     }));
 }
コード例 #2
0
        public ActionResult Post([FromBody] ContaLuz entity)
        {
            var imovel = imovelRepositories.GetByID(entity.idimovel);

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

            Repositories.Create(entity);

            return(Ok(new
            {
                status = "200",
                msg = "OK",
                obj = entity
            }));
        }