public async Task <IHttpActionResult> GetSingleAsync(int id) { try { var result = await _repository.GetSuppliersAsync(id); if (result != null) { var mappedResult = _mapper.Map <SupplierModel>(result); return(Ok(mappedResult)); } else { return(Content(HttpStatusCode.NotFound, string.Format("Supplier with id {0} could not be found", id))); } } catch { return(InternalServerError()); } }