Skip to content

Commit 03d4c66

Browse files
author
zzzprojects
committed
Fixing Audit Clone method
Fixing Audit Clone method
1 parent 40a7b65 commit 03d4c66

File tree

22 files changed

+146
-37
lines changed

22 files changed

+146
-37
lines changed

src/Z.EntityFramework.Plus.EF5.NET40/Audit/AuditConfiguration.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public AuditConfiguration()
4747
#endif
4848
}
4949

50+
/// <summary>Gets or sets the audit entry factory.</summary>
51+
/// <value>The audit entry factory.</value>
5052
public Func<AuditEntryFactoryArgs, AuditEntry> AuditEntryFactory { get; set; }
5153

54+
/// <summary>Gets or sets the audit entry property factory.</summary>
55+
/// <value>The audit entry property factory.</value>
5256
public Func<AuditEntryPropertyArgs, AuditEntryProperty> AuditEntryPropertyFactory { get; set; }
5357

5458
/// <summary>Gets or sets the automatic audit save pre action.</summary>
@@ -129,6 +133,8 @@ public AuditConfiguration Clone()
129133
{
130134
var audit = new AuditConfiguration
131135
{
136+
AuditEntryFactory = AuditEntryFactory,
137+
AuditEntryPropertyFactory = AuditEntryPropertyFactory,
132138
AutoSavePreAction = AutoSavePreAction,
133139
IgnoreEntityAdded = IgnoreEntityAdded,
134140
IgnoreEntityModified = IgnoreEntityModified,
@@ -142,7 +148,10 @@ public AuditConfiguration Clone()
142148
ExcludeIncludeEntityPredicates = new List<Func<object, bool?>>(ExcludeIncludeEntityPredicates),
143149
ExcludeIncludePropertyPredicates = new List<Func<object, string, bool?>>(ExcludeIncludePropertyPredicates),
144150
SoftAddedPredicates = new List<Func<object, bool>>(SoftAddedPredicates),
145-
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates)
151+
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates),
152+
#if EF5 || EF6
153+
UseNullForDBNullValue = UseNullForDBNullValue
154+
#endif
146155
};
147156

148157
return audit;

src/Z.EntityFramework.Plus.EF5.NET40/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
[assembly: AssemblyCulture("")]
1919
[assembly: ComVisible(false)]
2020
[assembly: Guid("e4c2af73-caeb-4429-bcb6-0a359484e064")]
21-
[assembly: AssemblyVersion("1.4.8")]
22-
[assembly: AssemblyFileVersion("1.4.8")]
21+
[assembly: AssemblyVersion("1.4.9")]
22+
[assembly: AssemblyFileVersion("1.4.9")]

src/Z.EntityFramework.Plus.EF5/Audit/AuditConfiguration.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public AuditConfiguration()
4747
#endif
4848
}
4949

50+
/// <summary>Gets or sets the audit entry factory.</summary>
51+
/// <value>The audit entry factory.</value>
5052
public Func<AuditEntryFactoryArgs, AuditEntry> AuditEntryFactory { get; set; }
5153

54+
/// <summary>Gets or sets the audit entry property factory.</summary>
55+
/// <value>The audit entry property factory.</value>
5256
public Func<AuditEntryPropertyArgs, AuditEntryProperty> AuditEntryPropertyFactory { get; set; }
5357

5458
/// <summary>Gets or sets the automatic audit save pre action.</summary>
@@ -129,6 +133,8 @@ public AuditConfiguration Clone()
129133
{
130134
var audit = new AuditConfiguration
131135
{
136+
AuditEntryFactory = AuditEntryFactory,
137+
AuditEntryPropertyFactory = AuditEntryPropertyFactory,
132138
AutoSavePreAction = AutoSavePreAction,
133139
IgnoreEntityAdded = IgnoreEntityAdded,
134140
IgnoreEntityModified = IgnoreEntityModified,
@@ -142,7 +148,10 @@ public AuditConfiguration Clone()
142148
ExcludeIncludeEntityPredicates = new List<Func<object, bool?>>(ExcludeIncludeEntityPredicates),
143149
ExcludeIncludePropertyPredicates = new List<Func<object, string, bool?>>(ExcludeIncludePropertyPredicates),
144150
SoftAddedPredicates = new List<Func<object, bool>>(SoftAddedPredicates),
145-
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates)
151+
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates),
152+
#if EF5 || EF6
153+
UseNullForDBNullValue = UseNullForDBNullValue
154+
#endif
146155
};
147156

148157
return audit;

src/Z.EntityFramework.Plus.EF5/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
[assembly: AssemblyCulture("")]
1919
[assembly: ComVisible(false)]
2020
[assembly: Guid("abcbb878-043c-4957-a334-90e9872e684e")]
21-
[assembly: AssemblyVersion("1.4.8")]
22-
[assembly: AssemblyFileVersion("1.4.8")]
21+
[assembly: AssemblyVersion("1.4.9")]
22+
[assembly: AssemblyFileVersion("1.4.9")]

src/Z.EntityFramework.Plus.EF6.NET40/Audit/Audit/AuditEntityAdded.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved.
77

88
#if EF5
9+
using System;
910
using System.Data.Objects;
1011
using System.Linq;
1112

src/Z.EntityFramework.Plus.EF6.NET40/Audit/Audit/AuditRelationshipAdded.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#if EF5 || EF6
99

1010
#if EF5
11+
using System;
1112
using System.Data;
1213
using System.Data.Objects;
1314

src/Z.EntityFramework.Plus.EF6.NET40/Audit/Audit/AuditRelationshipDeleted.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#if EF5 || EF6
99
#if EF5
10+
using System;
1011
using System.Data;
1112
using System.Data.Objects;
1213

src/Z.EntityFramework.Plus.EF6.NET40/Audit/AuditConfiguration.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public AuditConfiguration()
4747
#endif
4848
}
4949

50+
/// <summary>Gets or sets the audit entry factory.</summary>
51+
/// <value>The audit entry factory.</value>
5052
public Func<AuditEntryFactoryArgs, AuditEntry> AuditEntryFactory { get; set; }
5153

54+
/// <summary>Gets or sets the audit entry property factory.</summary>
55+
/// <value>The audit entry property factory.</value>
5256
public Func<AuditEntryPropertyArgs, AuditEntryProperty> AuditEntryPropertyFactory { get; set; }
5357

5458
/// <summary>Gets or sets the automatic audit save pre action.</summary>
@@ -129,6 +133,8 @@ public AuditConfiguration Clone()
129133
{
130134
var audit = new AuditConfiguration
131135
{
136+
AuditEntryFactory = AuditEntryFactory,
137+
AuditEntryPropertyFactory = AuditEntryPropertyFactory,
132138
AutoSavePreAction = AutoSavePreAction,
133139
IgnoreEntityAdded = IgnoreEntityAdded,
134140
IgnoreEntityModified = IgnoreEntityModified,
@@ -142,7 +148,10 @@ public AuditConfiguration Clone()
142148
ExcludeIncludeEntityPredicates = new List<Func<object, bool?>>(ExcludeIncludeEntityPredicates),
143149
ExcludeIncludePropertyPredicates = new List<Func<object, string, bool?>>(ExcludeIncludePropertyPredicates),
144150
SoftAddedPredicates = new List<Func<object, bool>>(SoftAddedPredicates),
145-
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates)
151+
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates),
152+
#if EF5 || EF6
153+
UseNullForDBNullValue = UseNullForDBNullValue
154+
#endif
146155
};
147156

148157
return audit;

src/Z.EntityFramework.Plus.EF6.NET40/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@
1818
[assembly: AssemblyCulture("")]
1919
[assembly: ComVisible(false)]
2020
[assembly: Guid("ac398eb8-0a31-4d06-a804-84d10b6da96d")]
21-
[assembly: AssemblyVersion("1.4.8")]
22-
[assembly: AssemblyFileVersion("1.4.8")]
21+
[assembly: AssemblyVersion("1.4.9")]
22+
[assembly: AssemblyFileVersion("1.4.9")]

src/Z.EntityFramework.Plus.EF6/Audit/AuditConfiguration.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ public AuditConfiguration()
4747
#endif
4848
}
4949

50+
/// <summary>Gets or sets the audit entry factory.</summary>
51+
/// <value>The audit entry factory.</value>
5052
public Func<AuditEntryFactoryArgs, AuditEntry> AuditEntryFactory { get; set; }
5153

54+
/// <summary>Gets or sets the audit entry property factory.</summary>
55+
/// <value>The audit entry property factory.</value>
5256
public Func<AuditEntryPropertyArgs, AuditEntryProperty> AuditEntryPropertyFactory { get; set; }
5357

5458
/// <summary>Gets or sets the automatic audit save pre action.</summary>
@@ -129,6 +133,8 @@ public AuditConfiguration Clone()
129133
{
130134
var audit = new AuditConfiguration
131135
{
136+
AuditEntryFactory = AuditEntryFactory,
137+
AuditEntryPropertyFactory = AuditEntryPropertyFactory,
132138
AutoSavePreAction = AutoSavePreAction,
133139
IgnoreEntityAdded = IgnoreEntityAdded,
134140
IgnoreEntityModified = IgnoreEntityModified,
@@ -142,7 +148,10 @@ public AuditConfiguration Clone()
142148
ExcludeIncludeEntityPredicates = new List<Func<object, bool?>>(ExcludeIncludeEntityPredicates),
143149
ExcludeIncludePropertyPredicates = new List<Func<object, string, bool?>>(ExcludeIncludePropertyPredicates),
144150
SoftAddedPredicates = new List<Func<object, bool>>(SoftAddedPredicates),
145-
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates)
151+
SoftDeletedPredicates = new List<Func<object, bool>>(SoftDeletedPredicates),
152+
#if EF5 || EF6
153+
UseNullForDBNullValue = UseNullForDBNullValue
154+
#endif
146155
};
147156

148157
return audit;

0 commit comments

Comments
 (0)