public IHttpActionResult Select([FromUri] string expand = null) { try { var values = service.Select(expand ?? defaultExpand) .ToList(); return(Ok(values)); } catch (UnauthorizedAccessException) { return(StatusCode(HttpStatusCode.Forbidden)); } catch (Exception e) { return(InternalServerError(e)); } }
public ActionResult List([FromQuery] string expand = defaultExpand) { try { var values = service.Select(expand).ToList(); return(Ok(values)); } catch (UnauthorizedAccessException) { return(Forbid()); } catch (Exception e) { //return StatusCode(StatusCodes.Status500InternalServerError, e); //return new StatusCodeResult(StatusCodes.Status500InternalServerError); //throw e; return(this.InternalServerError(e)); } }