Profile: faheemsalik


User posts

one year ago


I am facing an error in v4.1, while I add navigation property in Customer Table using another partial class

Error is:
"Navigation property 'Addresses' on entity type 'Customer' is not virtual. UseLazyLoadingProxies requires all entity types to be public, unsealed, have virtual navigation properties, and have a public or protected constructor"

// this is the collection I added with foreign reference
protected ICollection<UserFriend> _userFriends;
public virtual ICollection<UserFriend> UserFriends
            get => userFriends ?? (userFriends = new List<UserFriend>());
            protected set => _userFriends = value;

I found an answer to it on google that We need to use EF Core proxies if Lazyloading is enabled in the following link

Need an urgent reply/fix if possible.