Beispiel #1
0
 public IActionResult Get()
 {
     try
     {
         return(Ok(context.Get()));
     }
     catch (Exception ex)
     {
         return(BadRequest(new ErrorMessage(ex.Message)));
     }
 }
Beispiel #2
0
        // GET: api/City

        public IHttpActionResult Get()
        {
            try
            {
                return(Ok(context.Get()));
            }
            catch (Exception ex)
            {
                return(Content(HttpStatusCode.NotFound, ex.Message));
            }
        }