社区
.NET技术其他语言
帖子详情
use the static Mapper instance to initialize AutoMapper
baidu_35502798
2017-05-02 03:47:06
use the static Mapper instance to initialize AutoMapper
...全文
89
1
打赏
收藏
use the static Mapper instance to initialize AutoMapper
use the static Mapper instance to initialize AutoMapper
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
1 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
x80819092
2017-05-02
打赏
举报
回复
Mapper.Initialize(cfg => { cfg.CreateMap<Foo, Bar>(); cfg.AddProfile<FooProfile>(); });
Auto
Mapper
5.0-升级指南
Initialization You now must
use
either
Mapper
.
Initialize
or new
Mapper
Configuration() to
initialize
Auto
Mapper
. If you prefer to keep the
static
usage,
use
Mapper
.
Initialize
. If you have a lot of Mapp...
Auto
Mapper
基本使用 Mapster
1、
Initialize
:
Mapper
初始化
Mapper
.
Initialize
(x => x.CreateMap<Destination, Source>() );
Mapper
.
Initialize
(cfg => { cfg.CreateMap<Aliens, Person>(); });
Mapper
.
Initialize
(cfg...
静态和实例初始化映射
In 4.2.1 version of Auto
Mapper
and later, Auto
Mapper
provides two APIs: a
static
and an
instance
API. The
static
API:
Mapper
.
Initialize
(cfg => { cfg.AddProfile<AppProfile>(); cfg.Crea...
Auto
Mapper
8.0的应用--动态配置
Auto
Mapper
8.0中,需要使用configure来配置
mapper
。为此,实现动态的类型配置如下 public
static
class AutoMapHelper { private
static
bool ConfigExist(Type srcType, Type destType) { return Mappe...
Auto
Mapper
在项目中加入Auto
Mapper
1、编写影射 //DTO(Dto):数据传输对象,和ViewModel同样的功能 public class Dto
Mapper
s { //注册
Mapper
:在Global.asax中注册 public
static
void
Mapper
Register() { ...
.NET技术其他语言
1,979
社区成员
12,489
社区内容
发帖
与我相关
我的任务
.NET技术其他语言
.NET技术 其他语言讨论
复制链接
扫一扫
分享
社区描述
.NET技术 其他语言讨论
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章