Thursday, February 18, 2010

Programmer - AutoMapper with c# 2.0 syntax

Programmer Question

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))

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails