-
-
Notifications
You must be signed in to change notification settings - Fork 318
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
47 changed files
with
763 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/shared/Z.EF.Plus.Audit.Shared/AuditConfiguration/ExcludeByEntry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
using System; | ||
|
||
#if EF5 | ||
using System.Data.Entity; | ||
using System.Data.Objects; | ||
|
||
#elif EF6 | ||
using System.Data.Entity; | ||
using System.Data.Entity.Core.Objects; | ||
|
||
#elif EFCORE | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.ChangeTracking; | ||
|
||
#endif | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
public partial class AuditConfiguration | ||
{ | ||
/// <summary>Excludes (by entity entry) from the audit all entities which satisfy the predicate.</summary> | ||
/// <param name="excludeEntityPredicate">The exclude entity predicate.</param> | ||
/// <returns>An AuditConfiguration.</returns> | ||
#if EF5 || EF6 | ||
public AuditConfiguration ExcludeByEntry(Func<ObjectStateEntry, bool> excludeEntityPredicate) | ||
#elif EFCORE | ||
public AuditConfiguration ExcludeByEntry(Func<EntityEntry, bool> excludeEntityPredicate) | ||
#endif | ||
|
||
{ | ||
ExcludeIncludeByInstanceEntityPredicates.Add(x => excludeEntityPredicate(x) ? (bool?) false : null); | ||
return this; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/shared/Z.EF.Plus.Audit.Shared/AuditConfiguration/ExcludeByInstance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
using System; | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
public partial class AuditConfiguration | ||
{ | ||
/// <summary>Excludes (by entity instance) from the audit all entities which satisfy the predicate.</summary> | ||
/// <param name="excludeEntityPredicate">The exclude entity predicate.</param> | ||
/// <returns>An AuditConfiguration.</returns> | ||
public AuditConfiguration ExcludeByInstance(Func<object, bool> excludeEntityPredicate) | ||
{ | ||
ExcludeIncludeByInstanceEntityPredicates.Add(x => excludeEntityPredicate(x.Entity) ? (bool?)false : null); | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/shared/Z.EF.Plus.Audit.Shared/AuditConfiguration/IncludeByEntry.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
using System; | ||
|
||
#if EF5 | ||
using System.Data.Entity; | ||
using System.Data.Objects; | ||
|
||
#elif EF6 | ||
using System.Data.Entity; | ||
using System.Data.Entity.Core.Objects; | ||
|
||
#elif EFCORE | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.ChangeTracking; | ||
|
||
#endif | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
public partial class AuditConfiguration | ||
{ | ||
/// <summary>Includes (by entity entry) from the audit all entities which satisfy the predicate.</summary> | ||
/// <param name="includeEntityPredicate">The include entity predicate.</param> | ||
/// <returns>An AuditConfiguration.</returns> | ||
#if EF5 || EF6 | ||
public AuditConfiguration IncludeByEntry(Func<ObjectStateEntry, bool> includeEntityPredicate) | ||
#elif EFCORE | ||
public AuditConfiguration IncludeByEntry(Func<EntityEntry, bool> includeEntityPredicate) | ||
#endif | ||
|
||
{ | ||
ExcludeIncludeByInstanceEntityPredicates.Add(x => includeEntityPredicate(x) ? (bool?)true : null); | ||
return this; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/shared/Z.EF.Plus.Audit.Shared/AuditConfiguration/IncludeByInstance.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Description: Entity Framework Bulk Operations & Utilities (EF Bulk SaveChanges, Insert, Update, Delete, Merge | LINQ Query Cache, Deferred, Filter, IncludeFilter, IncludeOptimize | Audit) | ||
// Website & Documentation: https://github.com/zzzprojects/Entity-Framework-Plus | ||
// Forum & Issues: https://github.com/zzzprojects/EntityFramework-Plus/issues | ||
// License: https://github.com/zzzprojects/EntityFramework-Plus/blob/master/LICENSE | ||
// More projects: http://www.zzzprojects.com/ | ||
// Copyright © ZZZ Projects Inc. 2014 - 2016. All rights reserved. | ||
|
||
using System; | ||
|
||
namespace Z.EntityFramework.Plus | ||
{ | ||
public partial class AuditConfiguration | ||
{ | ||
/// <summary>Includes (by entity instance) from the audit all entities which satisfy the predicate.</summary> | ||
/// <param name="includeEntityPredicate">The include entity predicate.</param> | ||
/// <returns>An AuditConfiguration.</returns> | ||
public AuditConfiguration IncludeByInstance(Func<object, bool> includeEntityPredicate) | ||
{ | ||
ExcludeIncludeByInstanceEntityPredicates.Add(x => includeEntityPredicate(x.Entity) ? (bool?) true : null); | ||
return this; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.