You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to rebuild a graph, my entity provided a relation to a lazy-loaded proxy.
In the EntityManager.cs file, there are multiple references of getting the type from an object. My solution was adding the ObjectContext.GetObjectType() function on the type provided (or the type of the object provided).
For example on line 75:
publicIEnumerable<PropertyInfo>GetPrimaryKeyFieldsFor(TypeentityType){varmetadata=ObjectContext.MetadataWorkspace.GetItems<EntityType>(DataSpace.OSpace).SingleOrDefault(p =>p.FullName==ObjectContext.GetObjectType(entityType).FullName);if(metadata==null){thrownewInvalidOperationException(String.Format("The type {0} is not known to the DbContext.",entityType.FullName));}returnmetadata.KeyMembers.Select(k =>entityType.GetProperty(k.Name,BindingFlags.Instance|BindingFlags.NonPublic|BindingFlags.Public)).ToList();}