腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
首页
标签
automapper
#
automapper
关注
专栏文章
(8)
技术视频
(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 订阅
编程进阶实战
526 文章
28 订阅
DotNet NB && CloudNative
1K 文章
52 订阅
DotNet 致知
216 文章
29 订阅
NetCore 从壹开始
211 文章
38 订阅
领券