AutoMapper with c# 2.0 syntax

Posted by Morri on Stack Overflow See other posts from Stack Overflow or by Morri
Published on 2010-02-12T11:05:35Z Indexed on 2010/03/13 4:55 UTC
Read the original article Hit count: 428

Filed under:
|
|

I'm trying to create a custom mapping with AutoMapper, but I can't use 3.0 syntax with lambdas. How would one convert this 3.0 code into 2.0 ?

Mapper.CreateMap<MyClass, MyDto>()
 .ForMember(dest => dest.Name, opt => opt.MapFrom(src => src.CompanyName))

Edit:

Since there was no better solution, we are now using vs2008 on one workstation to make these mappings and build a dll. I hope it won't be long until we upgrade to vs2010.

© Stack Overflow or respective owner

Related posts about c#2.0

Related posts about c#3.0