Sieve icon indicating copy to clipboard operation
Sieve copied to clipboard

Unable to utilize EF.Property shadow property fields in EF Core

Open DanoThom opened this issue 6 years ago • 0 comments

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();

DanoThom avatar Nov 19 '19 16:11 DanoThom