Skip to content

Commit 43963ae

Browse files
author
zzzprojects
committed
Add conditional compilation for ef6
Add conditional compilation for ef6
1 parent f730463 commit 43963ae

File tree

1 file changed

+12
-5
lines changed
  • src/shared/Z.EF.Plus.Audit.Shared

1 file changed

+12
-5
lines changed

src/shared/Z.EF.Plus.Audit.Shared/Audit.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,13 @@ public Audit()
6060
private static Func<ObjectStateEntry, object> RelationshipEntryKey1;
6161

6262
public static object GetRelationshipEntryKey0(ObjectStateEntry entry)
63-
{
64-
var relationshipEntryType = typeof(ObjectStateEntry).Assembly.GetType("System.Data.Objects.RelationshipEntry");
63+
{
6564

65+
#if EF5
66+
var relationshipEntryType = typeof(ObjectStateEntry).Assembly.GetType("System.Data.Objects.RelationshipEntry");
67+
#else
68+
var relationshipEntryType = typeof(ObjectStateEntry).Assembly.GetType("System.Data.Entity.Core.Objects.RelationshipEntry");
69+
#endif
6670
if (RelationshipEntryKey0 == null)
6771
{
6872
// Parameter
@@ -82,8 +86,11 @@ public static object GetRelationshipEntryKey0(ObjectStateEntry entry)
8286

8387
public static object GetRelationshipEntryKey1(ObjectStateEntry entry)
8488
{
89+
#if EF5
8590
var relationshipEntryType = typeof(ObjectStateEntry).Assembly.GetType("System.Data.Objects.RelationshipEntry");
86-
91+
#else
92+
var relationshipEntryType = typeof(ObjectStateEntry).Assembly.GetType("System.Data.Entity.Core.Objects.RelationshipEntry");
93+
#endif
8794
if (RelationshipEntryKey1 == null)
8895
{
8996
// Parameter
@@ -103,8 +110,8 @@ public static object GetRelationshipEntryKey1(ObjectStateEntry entry)
103110
#endif
104111

105112

106-
/// <summary>Gets or sets the entries.</summary>
107-
/// <value>The entries.</value>
113+
/// <summary>Gets or sets the entries.</summary>
114+
/// <value>The entries.</value>
108115
public List<AuditEntry> Entries { get; set; }
109116

110117
/// <summary>Gets or sets the created by username.</summary>

0 commit comments

Comments
 (0)