Skip to content

Commit 0ea35c0

Browse files
Add GetObjectType
1 parent 1fd0451 commit 0ea35c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

GraphDiff/GraphDiff.Shared/Internal/Graph/GraphNode.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected static EntityKey CreateEntityKey(IObjectContextAdapter context, object
7474
throw new ArgumentNullException("entity");
7575
}
7676

77-
return context.ObjectContext.CreateEntityKey(context.GetEntitySetName(entity.GetType()), entity);
77+
return context.ObjectContext.CreateEntityKey(context.GetEntitySetName(ObjectContext.GetObjectType(entity.GetType())), entity);
7878
}
7979

8080
internal void GetIncludeStrings(DbContext context, List<string> includeStrings)
@@ -190,7 +190,7 @@ private static object FindEntityByKey(DbContext context, object associatedEntity
190190

191191
protected static object CreateEmptyEntityWithKey(IObjectContextAdapter context, object entity)
192192
{
193-
var instance = Activator.CreateInstance(entity.GetType());
193+
var instance = Activator.CreateInstance(ObjectContext.GetObjectType(entity.GetType()));
194194
CopyPrimaryKeyFields(context, entity, instance);
195195
return instance;
196196
}

0 commit comments

Comments
 (0)