Skip to content

Commit

Permalink
Added DateRange events
Browse files Browse the repository at this point in the history
  • Loading branch information
ackava committed Jan 6, 2023
1 parent 3956ba6 commit 7be66c3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions NeuroSpeech.EntityAccessControl/DbContextEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public class DbContextEvents<T>

private readonly Dictionary<Type, Type> registrations = new();

public DbContextEvents()
{
Register<DateRangeEvents>();
}

internal abstract class EntityHandler
{
public abstract Task Run(DbContext db, object entity);
Expand Down Expand Up @@ -61,4 +66,12 @@ public void Register<T1>()
registrations[et] = t;
}
}

internal class DateRangeEvents: DbEntityEvents<DateRange>
{
public override IQueryable<DateRange> Filter(IQueryable<DateRange> q)
{
return q;
}
}
}

0 comments on commit 7be66c3

Please sign in to comment.