- What is your product version?
- What is your product type (Angular or MVC)?
- What is product framework type (.net framework or .net core)?
- .net core
Hi, I'm trying to built an "global filter", like a scope, to filter all my queries on entities that depends on it. Mix between Tenant and Localization.
My questions are:
- What is the best approach to get the setting value and add it to my Session?
- Also, and how can i apply it in all my queries?
- I'll need inherit all my class Entities from Interface IMayHaveProject and/or IMustHaveProject that must be created?
Thanks in advance.
To create a global filter, you can check https://aspnetboilerplate.com/Pages/Documents/Articles\How-To\add-custom-data-filter-ef-core.
You can directly use SettingManager in your DbContext to retrieve the value you want to use as a filter.