Automapper v8 is not ignoring navigation properties of EF (Entity Framework) class

asp.net-core automapper entity-framework-6

Popular Answer

By altering the mapping profile class as shown below, I was able to fix it.

public class MyMappingProfile: Profile
{
    public MyMappingProfile()
    {
        CreateMap<MyModelClass, MyEntityClass>()
            .ForMember(dest => dest.NavigationProp1, opt => opt.Ignore())
            .ForMember(dest => dest.NavigationProp2, opt => opt.Ignore());
    }
}

Cheers.

2
3/27/2019 7:56:28 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow