public Attachment GetAttachment(Guid id) { try { return(_attachRepository.GetAttachment(id)); } catch (SqlException exception) { var response = new HttpResponseMessage(HttpStatusCode.NotFound) { Content = new StringContent(exception.Message) }; throw new HttpResponseException(response); } catch (Exception exception) { var response = new HttpResponseMessage(HttpStatusCode.BadRequest) { Content = new StringContent(exception.Message) }; throw new HttpResponseException(response); } }