I want add CompanyID filter to my all entity framework request.Because each user must see just their records.I dont want add filter (x=>x.CompanyID == cID) all methods in bu
everything you suggest does not work for the following scenario: HasQueryFilter
power, but per each HTTP request. ApplyGlobalFilters
/ OnModelCreating
applied once for model creation. But if you reload the page with different request parameters - they won't be taken into account to filter out DbSet
.
If you add the filter to GetAll
call - another call 'Include
'-ing the entity won't have this filter.
We need real global mechanism to filter out DbSet
s by specific condition - which may change per each request (page refresh).