@@ -28,11 +28,33 @@ public static IQueryable<AuditEntry> Where<T>(this DbSet<AuditEntry> set, T entr
2828 }
2929
3030 public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , T entry ) where TAuditEntry : AuditEntry where T : class
31+ {
32+ return set . Where < TAuditEntry , T > ( AuditManager . DefaultConfiguration , entry ) ;
33+ }
34+
35+ public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , params object [ ] keyValues ) where T : class
36+ {
37+ return set . Where < AuditEntry , T > ( keyValues ) ;
38+ }
39+
40+ public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , params object [ ] keyValues ) where TAuditEntry : AuditEntry where T : class
41+ {
42+ return set . Where < TAuditEntry , T > ( AuditManager . DefaultConfiguration , keyValues ) ;
43+ }
44+
45+ public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , AuditConfiguration auditConfiguration , T entry ) where T : class
46+ {
47+ return set . Where < AuditEntry , T > ( auditConfiguration , entry ) ;
48+ }
49+
50+ public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , AuditConfiguration auditConfiguration , T entry ) where TAuditEntry : AuditEntry where T : class
3151 {
3252 var context = set . GetDbContext ( ) ;
3353 var keyNames = context . GetKeyNames < T > ( ) ;
3454
35- var name = AuditManager . DefaultConfiguration . DataAnnotationEntityDisplayName ( typeof ( T ) ) ;
55+ var name = auditConfiguration . EntityNameFactory != null ?
56+ auditConfiguration . EntityNameFactory ( typeof ( T ) ) :
57+ typeof ( T ) . Name ;
3658
3759 if ( entry == null )
3860 {
@@ -55,17 +77,19 @@ public static IQueryable<TAuditEntry> Where<TAuditEntry, T>(this DbSet<TAuditEnt
5577 return query ;
5678 }
5779
58- public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , params object [ ] keyValues ) where T : class
80+ public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , AuditConfiguration auditConfiguration , params object [ ] keyValues ) where T : class
5981 {
60- return set . Where < AuditEntry , T > ( keyValues ) ;
82+ return set . Where < AuditEntry , T > ( auditConfiguration , keyValues ) ;
6183 }
6284
63- public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , params object [ ] keyValues ) where TAuditEntry : AuditEntry where T : class
85+ public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , AuditConfiguration auditConfiguration , params object [ ] keyValues ) where TAuditEntry : AuditEntry where T : class
6486 {
6587 var context = set . GetDbContext ( ) ;
6688 var keyNames = context . GetKeyNames < T > ( ) ;
6789
68- var name = AuditManager . DefaultConfiguration . DataAnnotationEntityDisplayName ( typeof ( T ) ) ;
90+ var name = auditConfiguration . EntityNameFactory != null ?
91+ auditConfiguration . EntityNameFactory ( typeof ( T ) ) :
92+ typeof ( T ) . Name ;
6993
7094 var query = set . Where ( x => x . EntityTypeName == name ) ;
7195
0 commit comments