I am trying to understand if I can use teary operators within a lambda expression.
For example:
public class Foo
{ public int ID {get; set;} public string Name {get; set;} public Address MyAdd {get; set;}
}
I then want to do something like this:
var config = new MapperConfiguration(c => { c.CreateMap<foo, MyFoo>() .ForMember(x => x.ID, m => m.MapFrom(a => a.ID)) .ForMember(x => x.Name, m => m.MapFrom(a => a.Name)) .ForMember(x => x.Add1, m => m.MapFrom(a => (a.MyAdd != null) ? a.MyAdd.Line1 : string.Empty)); });
However I get the error:
Cannot convert lambda expression to type 'string' because it is not a delegate type