Esempio n. 1
0
 public ActionResult Delete([FromBody] UsuarioSeletor seletor)
 {
     try
     {
         _service.Delete(seletor);
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }
Esempio n. 2
0
        public ActionResult List([FromBody] UsuarioSeletor seletor)
        {
            try
            {
                if (seletor == null)
                {
                    throw new Exception("Filtro inválido");
                }

                return(Ok(new ResponseViewModel
                {
                    Data = _service.GetList(seletor),
                    Count = _service.Count(seletor)
                }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }