Example #1
0
        public async Task <List <ProjectListDTO> > GetProjectListAsync(QueryProjectFilterModel filterModel)
        {
            List <Project> projectsFromDb = await _projectRepository.FindAsync(filterModel, m => m.Name, SortOrder.Ascending);

            var result = _mapper.Map <List <ProjectListDTO> >(projectsFromDb);

            return(result);
        }
Example #2
0
        public async Task <ResultModel <List <ProjectListDTO> > > GetProjectList(QueryProjectFilterModel filterModel)
        {
            try
            {
                List <ProjectListDTO> result = await projectService.GetProjectListAsync(filterModel);

                return(ResultModel <List <ProjectListDTO> > .Success(result, "查询成功"));
            }
            catch (AspectInvocationException ex)
            {
                return(ResultModel <List <ProjectListDTO> > .Fail(ex.InnerException?.Message));
            }
            catch (MateralConfigCenterException ex)
            {
                return(ResultModel <List <ProjectListDTO> > .Fail(ex.Message));
            }
        }