public IEnumerable <DocumentUploadResponse> Get() { var docs = _unitOfWork.Documentfiles.GetAll(); var d = docs.Select <DocumentFile, DocumentUploadResponse>((s) => { var t = new DocumentUploadResponse(); t.ParseToViewModel(s); return(t); }).ToList(); return(d); }
public JsonResult Get(int id) { var resultSet = new DocumentUploadResponse(); var foundDocument = _unitOfWork.Documentfiles.Get(id); if (foundDocument != null) { resultSet.ParseToViewModel(foundDocument); } else { resultSet.AddError(0, "Няма намерен Документ в системата"); } return(new JsonResult(resultSet)); }