public IActionResult Get(int id)
 {
     try
     {
         var search = new ShipperSearch
         {
             Id = id
         };
         var result = _getShippers.Execute(search);
         return(Ok(result.First()));
     }
     catch (EntityNotFoundException e)
     {
         return(NotFound(e.Message));
     }
     catch (Exception e)
     {
         return(StatusCode(500, e.Message));
     }
 }
Exemple #2
0
        public IActionResult Create()
        {
            var viewmodel = _getShippers.Execute(new ShipperSearch());

            return(View(viewmodel));
        }