public IActionResult Get([FromHeader] string Authorization) { try { var result = repo.Read(0); return(Ok(result)); } catch (RepoException ex) { switch (ex.RepoExceptionType) { case RepoException.ExceptionType.NOCONTENT: case RepoException.ExceptionType.NOTFOUND: return(StatusCode(StatusCodes.Status204NoContent)); case RepoException.ExceptionType.ERROR: return(StatusCode(StatusCodes.Status409Conflict)); case RepoException.ExceptionType.INVALIDARGUMENT: return(StatusCode(StatusCodes.Status400BadRequest)); case RepoException.ExceptionType.SQLERROR: return(StatusCode(StatusCodes.Status409Conflict)); } } return(StatusCode(StatusCodes.Status400BadRequest)); }