Пример #1
0
 public DataModel.Response.FindAllItemReponse <DataModel.Model.UploadModel> GetUploads()
 {
     try
     {
         IUploadRepository uploadRepository = RepositoryClassFactory.GetInstance().GetUploadRepository();
         IList <Upload>    uploads          = uploadRepository.FindAll();
         var _uploads = uploads.Select(a => MapperUtil.CreateMapper().Mapper.Map <Upload, UploadModel>(a)).ToList();
         return(new FindAllItemReponse <UploadModel>
         {
             Items = _uploads,
             ErrorCode = (int)ErrorCode.None,
             Message = string.Empty
         });
     }
     catch (Exception ex)
     {
         return(new FindAllItemReponse <UploadModel>
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }