Skip to content

Commit 56a67a3

Browse files
author
Andreas Pelzer
committed
Merge pull request #66 from andypelzer/master
Fix unit tests (issue #65)
2 parents c029f27 + c13d375 commit 56a67a3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

GraphDiff/GraphDiff/Internal/Graph/GraphNode.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ protected static void AttachRequiredNavigationProperties(DbContext context, obje
167167
var entityType = ObjectContext.GetObjectType(updating.GetType());
168168
foreach (var navigationProperty in context.GetRequiredNavigationPropertiesForType(updating.GetType()))
169169
{
170-
var navigationPropertyInfo = entityType.GetProperty(navigationProperty.Name, BindingFlags.Instance | BindingFlags.NonPublic);
171-
var associatedEntity = navigationPropertyInfo.GetValue(updating, null);
170+
var navigationPropertyInfo = entityType.GetProperty(navigationProperty.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public);
172171

172+
var associatedEntity = navigationPropertyInfo.GetValue(updating, null);
173173
if (associatedEntity != null)
174174
{
175175
associatedEntity = FindEntityByKey(context, associatedEntity);
@@ -224,7 +224,7 @@ private static void EnsureConcurrency<T>(IObjectContextAdapter db, T entity1, T
224224
var conceptualType = metadata.GetItems<EntityType>(DataSpace.CSpace).Single(p => p.FullName == cTypeName);
225225
var concurrencyProperties = conceptualType.Members
226226
.Where(member => member.TypeUsage.Facets.Any(facet => facet.Name == "ConcurrencyMode" && (ConcurrencyMode)facet.Value == ConcurrencyMode.Fixed))
227-
.Select(member => entityType.GetProperty(member.Name, BindingFlags.Instance | BindingFlags.NonPublic))
227+
.Select(member => entityType.GetProperty(member.Name, BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public))
228228
.ToList();
229229

230230
// Check if concurrency properties are equal

0 commit comments

Comments
 (0)