开发者

Automapper, mapping IEnumearble<Foo> to IEnumearble<FooDto>

I ve been trying to do something like this:

    ...
Mapper.CreateMap<IEnumerable<Foo>, IEnumerable<FooDto>>();
var fooDtos = Mapper.Map<IEnumerable<Foo>, IEnumerable<FooDto>>(foos);

Keep in 开发者_JAVA百科mind that Foo is an entity but the properties are exactly the same that FooDto. The Result of fooDtos is an empty enumerable Tips?


ok Its simple I should have mapped like this :

Mapper.CreateMap<Foo, FooDto>();

and that works Doh!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜