I'd like to implement a multi-tenant scenario. I only want to select my custom entities which has an Active boolean value.
I tried with the custom IDbSet<MyEntityType>
+ FilteredDbSet<MyEntityType>(this, c => c.Active==true)
from this answer, and with the custom partial class / custom named DbSet<MyEntityTpe> MyEntitiesTypeItems
+ a new property with the original name + the filter from this answer.
If I run the code in debug mode, for the first some inits for my partial class, MyEntityType.Load
has the proper count of Active=true items (30), but afterwards something happens (possibly a reload), and the filter is no longer active, on the Dynamic Data Scaffolding page, it will list all items (400).
I tried switching off LazyLoading and Proxying, but with no luck. Any hints what am I doing wrong?