예제 #1
0
 public IActionResult Post([FromBody] Promotorias promotorias)
 {
     try
     {
         _promotoriasRepository.Insert(promotorias);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
예제 #2
0
        public IActionResult Put([FromBody] Promotorias promotorias, int id)
        {
            try
            {
                if (id > 0 && id == promotorias.ID)
                {
                    _promotoriasRepository.Update(promotorias);
                }
                else
                {
                    return(BadRequest("Informe o id"));
                }

                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }