开发者

Can Automapper populate a strongly typed object from the data in a NameValueCollection?

Can Automapper map values from a NameValueCollection onto an object, where target.Foo receives the value stored in the collection under the "Foo" key?

I have a business object that stores some data in named properties and other data in a property bag. Different view开发者_JS百科s make different assumptions about the data in the property bag, which I capture in page-specific view models. I want to use AutoMapper to map both the "inherent" attributes (the ones that always exist) as well as the "dynamic" attributes (the ones that vary per view and may or may not exist).


Not out of the box right now, it's something I'm looking at for 2.0. You can however build a custom IObjectMapper to do this for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜