public async Task <ActionResult <AttachmentModel> > Get(int supplierId, int Id) { try { var result = await _repository.GetAttachmentAsync(supplierId, Id); if (result == null) { return(NotFound()); } return(_mapper.Map <AttachmentModel>(result)); } catch (Exception) { return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure")); } }