public IActionResult Get(int id) { try { var search = new OrderSearch { Id = id }; var result = _getOrders.Execute(search); return(Ok(result.First())); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }
public IActionResult Search([FromForm] OrderSearch search) { try { var viewmodel = _getOrders.Execute(search); return(PartialView(viewmodel)); } catch (EntityNotFoundException e) { return(NotFound(e.Message)); } catch (Exception e) { return(StatusCode(500, e.Message)); } }