博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
番外篇-AppService服务
阅读量:4982 次
发布时间:2019-06-12

本文共 2232 字,大约阅读时间需要 7 分钟。

一、

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

  

二、

 

public async Task
> 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
( 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()); }

  

转载于:https://www.cnblogs.com/fger/p/10688742.html

你可能感兴趣的文章
BZOJ 2819: Nim dfs序维护树状数组,倍增
查看>>
WinRAR(5.21)-0day漏洞-始末分析
查看>>
终端检测HTTPS服务端
查看>>
证件照换底色
查看>>
Candies
查看>>
EAS部署:linux 下安装EAS后启动不了服务
查看>>
[BZOJ3244][NOI2013] 树的计数
查看>>
[web]python3一句话开启http服务
查看>>
基于 控制台 简易 学生信息管理系统 (增、删、改)
查看>>
Cannot add foreign key constraint 错误解决办法
查看>>
To-Read List
查看>>
PHP漏洞全解(三)-客户端脚本植入
查看>>
重载类型运算符
查看>>
poj2676
查看>>
工作时候需要学习的东西
查看>>
Win8安装教程!笔记本用U盘安装Win8只需三步
查看>>
C语言中的字符串常量
查看>>
awk分隔符设定为多个字符或字符串
查看>>
DuoCode测试
查看>>
关于9080端口和80端口实现真正意义的WebServer+ApplicationServer结合应用
查看>>