Skip to content

Commit fad58c3

Browse files
committed
Add InvalidFilterException, enhance DbSet and Queryable extensions with pagination and dynamic sorting
1 parent 92e6573 commit fad58c3

4 files changed

Lines changed: 491 additions & 18 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
namespace EfCoreKit.Abstractions.Exceptions;
2+
3+
/// <summary>
4+
/// Thrown when a <see cref="EfCoreKit.Abstractions.Models.FilterDescriptor"/> is invalid —
5+
/// e.g. a missing field name or an unsupported operator.
6+
/// </summary>
7+
public sealed class InvalidFilterException : EfCoreKitException
8+
{
9+
/// <summary>
10+
/// Initializes a new instance of the <see cref="InvalidFilterException"/> class.
11+
/// </summary>
12+
/// <param name="message">The message that describes the error.</param>
13+
public InvalidFilterException(string message) : base(message) { }
14+
15+
/// <summary>
16+
/// Initializes a new instance of the <see cref="InvalidFilterException"/> class
17+
/// with an inner exception.
18+
/// </summary>
19+
/// <param name="message">The message that describes the error.</param>
20+
/// <param name="inner">The exception that caused this exception.</param>
21+
public InvalidFilterException(string message, Exception inner) : base(message, inner) { }
22+
}

src/EfCoreKit.Core/Context/EfCoreKitDbContext.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ private void OnBeforeSaveChanges()
8484
private void ConfigureGlobalFilters(ModelBuilder modelBuilder)
8585
{
8686
// TODO: Apply ISoftDeletable global filter
87+
88+
89+
8790
// TODO: Apply ITenantEntity global filter
8891
}
8992
}

0 commit comments

Comments
 (0)