• 番外篇-AppService服务


    一、

            public async Task<ListResultDto<ArchitectureDto>> GetArchitecture()
            {
                var architecture = _architectureRepository.GetAll();
                  var list= await architecture.ToListAsync();
                
    
                return new ListResultDto<ArchitectureDto>(
                    list.Select(item =>
                    {
                        var architectureDto = ObjectMapper.Map<ArchitectureDto>(item);
                        return architectureDto;
                    }).ToList());
            }
    

      

    二、

            public async Task<PagedResultDto<ArcClassroomListDto>> GetArchitectureClassroom(GetAllArchitecturesInput input)
            {
               var query = (from c in _classroomRepository.GetAll().Include("Architecture").Include("Nature").Include("Architecture.Parent.Parent").Include("Architecture.Children")
                             join a in _architectureRepository.GetAll() on c.ArchitectureId equals a.Id
                             join n in _natureRepository.GetAll() on c.NatureId equals n.Id
                            where a.Id == input.Id||a.ParentId== input.Id || a.Parent.ParentId == input.Id || a.Parent.Parent.ParentId == input.Id
                            select c);
               
                var totalCount = await query.CountAsync();
                
                var items = await query.OrderBy(input.Sorting?? "id asc").PageBy(input).ToListAsync();
              
                return new PagedResultDto<ArcClassroomListDto>(
                    totalCount,
                    items.Select(item =>
                    {
                           var organizationUnitUserDto = new ArcClassroomListDto();
                        organizationUnitUserDto.CampusName = item.Architecture.Parent.Parent.Name ;
                        organizationUnitUserDto.BuildingName = item.Architecture.Parent.Name;
                        organizationUnitUserDto.FloorName = item.Architecture.Name ;
                        organizationUnitUserDto.Name = item.Name;
                        organizationUnitUserDto.ClassroomNatureName = item.Nature.Name;
                        organizationUnitUserDto.Id = item.Id;
                        organizationUnitUserDto.Maximum = item.Maximum;
                        return organizationUnitUserDto;
                    }).ToList());
            }
    

      

  • 相关阅读:
    PageRequestManager 综述
    【转】浏览器集成教学 自定义浏览器
    COM(四)注册
    关于/ENTRY (EntryPoint Symbol)
    COFF文件
    【转】用系统默认浏览器打开Microsoft Web Browser控件触发的超链接
    Scroll Bar 控件
    COM(一)CoCreateInstance
    Web相关概念
    WebBrowser Control(一)禁止表单数据提示对话框
  • 原文地址:https://www.cnblogs.com/fger/p/10688742.html
Copyright © 2020-2023  润新知