@@ -23,6 +23,11 @@ namespace Z.EntityFramework.Plus
2323 public static partial class AuditExtensions
2424 {
2525 public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , T entry ) where T : class
26+ {
27+ return set . Where < AuditEntry , T > ( entry ) ;
28+ }
29+
30+ public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , T entry ) where TAuditEntry : AuditEntry where T : class
2631 {
2732 var context = set . GetDbContext ( ) ;
2833 var keyNames = context . GetKeyNames < T > ( ) ;
@@ -49,6 +54,11 @@ public static IQueryable<AuditEntry> Where<T>(this DbSet<AuditEntry> set, T entr
4954 }
5055
5156 public static IQueryable < AuditEntry > Where < T > ( this DbSet < AuditEntry > set , params object [ ] keyValues ) where T : class
57+ {
58+ return set . Where < AuditEntry , T > ( keyValues ) ;
59+ }
60+
61+ public static IQueryable < TAuditEntry > Where < TAuditEntry , T > ( this DbSet < TAuditEntry > set , params object [ ] keyValues ) where TAuditEntry : AuditEntry where T : class
5262 {
5363 var context = set . GetDbContext ( ) ;
5464 var keyNames = context . GetKeyNames < T > ( ) ;
@@ -59,6 +69,7 @@ public static IQueryable<AuditEntry> Where<T>(this DbSet<AuditEntry> set, params
5969 {
6070 throw new Exception ( ExceptionMessage . Audit_Key_Null ) ;
6171 }
72+
6273 if ( keyValues . Length != keyNames . Length )
6374 {
6475 throw new Exception ( ExceptionMessage . Audit_Key_OutOfBound ) ;
0 commit comments