I am trying to map using AutoMapper.
Source object is C# object
public class Source
{
public string comment { get; set; }
public string Subject { get; set; }
public Account Account{ get; set; }
}
public class Account
{
public string FirstName{ get; set; }
public string LastName{ get; set; }
}
My destination is a CRM entity named crm_destination which has fields like comment , Subject but it also has a LookUp field account of type Account.
But I don't know how to map LookUp field.
Following is my Automapper
AutoMapper.Mapper.CreateMap<Source, Destinaetion>()
.ForMember(dest => dest.comment, opt => opt.MapFrom(src => src.comment))
.ForMember(dest => dest.account, opt => opt.MapFrom(src => src.account));
.ForMember(dest => dest.account, opt => opt.MapFrom(src => src.account)) is throwing error of type mismatch..
basically my problem is I don't know how to map LookUp field where CRM entity is destination.