How to pass values to a Custom Resolver in Automap

2019-06-03 21:46发布

I need to pass values to my Custom Resolver. The values change, so I can't hard code them in my register static class. How can I achieve this?

// Called from global.asa page
   public static void Register()
    {
        Mapper.CreateMap<Task, TaskTableViewModel>().ForMember(dest => dest.DueDate,
                                                               opt => opt.ResolveUsing<DueDateResolver>().ConstructedBy(() => new DueDateResolver(dateFormatString))); 

}

1条回答
乱世女痞
2楼-- · 2019-06-03 22:23

I asked about this on another board and was told it isn't possible to do in this version.

查看更多
登录 后发表回答