腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
首页
标签
automapper
#
automapper
关注
专栏文章
(9)
技术视频
(0)
互动问答
(1)
Automapper能映射分页列表吗?
2
回答
automapper
、
对象
、
分页
、
模型
非碧卿
程序员
使用jRummell public static IPagedList<TDestination> ToMappedPagedList<TSource, TDestination>(this IPagedList<TSource> list) { IEnumerable<TDestination> sourceList = Mapper.Map<IEnumerable<TSource>, IEnumerable<TDestination>>(list); IPagedList<TDestination> pagedResult = new StaticPagedList<TDestination>(sourceList, list.GetMetaData()); return pagedResult; } 用法是: var pagedDepartments = database.Departments.OrderBy(orderBy).ToPagedList(pageNumber, pageSize).ToMappedPagedList<Department, DepartmentViewModel>();...
展开详请
赞
0
收藏
0
评论
0
分享
使用jRummell public static IPagedList<TDestination> ToMappedPagedList<TSource, TDestination>(this IPagedList<TSource> list) { IEnumerable<TDestination> sourceList = Mapper.Map<IEnumerable<TSource>, IEnumerable<TDestination>>(list); IPagedList<TDestination> pagedResult = new StaticPagedList<TDestination>(sourceList, list.GetMetaData()); return pagedResult; } 用法是: var pagedDepartments = database.Departments.OrderBy(orderBy).ToPagedList(pageNumber, pageSize).ToMappedPagedList<Department, DepartmentViewModel>();
热门
专栏
walterlv - 吕毅的博客
651 文章
46 订阅
编程进阶实战
617 文章
29 订阅
DotNet NB && CloudNative
1.5K 文章
56 订阅
DotNet 致知
216 文章
29 订阅
NetCore 从壹开始
211 文章
39 订阅
领券