Exemplo n.º 1
0
 public IActionResult GetById(int Id)
 {
     try
     {
         return(Ok(_service.Get(Id)));
     }
     catch (Exception e)
     {
         return(BadRequest(e.Message));
     }
 }
Exemplo n.º 2
0
 public IActionResult Get([FromQuery] ActorFilter filter)
 {
     try
     {
         var result = _service.Get(filter);
         if (result == null)
         {
             return(NotFound());
         }
         return(Ok(result));
     }
     catch (Exception e)
     {
         try { _logService.SendLogError(e); } catch (System.Exception ex) { return(StatusCode(503, ex)); }
         return(StatusCode(503, e));
     }
 }
Exemplo n.º 3
0
        // GET: Actor
        public ActionResult Index()
        {
            IEnumerable <Actor> listActors = service.Get();

            return(View(listActors));
        }