コード例 #1
0
        public async Task <IActionResult> GetAll([FromQuery] bool?hasTemplate, [FromQuery] int?operacaoId)
        {
            var collection = await _eventoService.GetAll(hasTemplate, operacaoId);

            var response = new GetAllEventoResponse()
            {
                Data = collection.ConvertEntityToSchema <EventoSchema>().OrderBy(x => x.Nome)
            };

            return(Ok(response));
        }
コード例 #2
0
 public IActionResult Get()
 {
     try
     {
         var eventos = eventoService.GetAll();
         return(Ok(eventos));
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #3
0
 public ActionResult <IEnumerable <string> > Get()
 {
     try
     {
         var Registros = _eventoService.GetAll();
         return(new OkObjectResult(Registros));
     }
     catch (ArgumentNullException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
コード例 #4
0
 public IEnumerable <Evento> GetAll()
 {
     return(_eventoService.GetAll());
 }