Sieve
Sieve copied to clipboard
Unable to utilize EF.Property shadow property fields in EF Core
Firstly, really handy library.
I've got some boilerplate audit fields (CreatedOn, LastModifiedBy etc etc) in an empty interface which are implemented on inheriting domain entities using EF Core shadow properties. You can refer to them in LINQ queries using the following standard EF Core LINQ :
context.SystemUsers.OrderByDescending(p => EF.Property<DateTimeOffset>(p, "CreatedOn"))
However when using the Sieve Fluent API mapping it doesn't appear to find the field and hence doesn't impact the query at all :
mapper.Property<SystemUser>(p => EF.Property<DateTimeOffset>(p, "CreatedOn")).CanFilter().CanSort();