I need to add a global filter to a repository entity, i.e. it has to be applied everywhere this entity is accessed on Application service layer. My filter contains two conditions. Whereas adding the first condition, which depends on a constant, is easy and applied in OnModelCreating using HasQueryFilter, I have no idea how to apply automatically the second one, which depends on the currently selected (or default) UI language.
Adding global session filter to repository entity
185 views Asked by Alexander At
1
There are 1 answers
Related Questions in ENTITY-FRAMEWORK-CORE
- Will it slow down the performance when Unit of work pattern is used with EF Core
- Entity Framework Core 8 dbcontext - can't add some rows in many-to-many relationship
- Upsert huge amount of data by EFCore.BulkExtensions
- .NET Core 8, how can I add properties to user account that contains multiple values?
- How to load data from a different context in Entity Framework Core?
- Passing GUID value through SqlQuery will raise the error: invalid input syntax for type uuid
- The specified data type in the EF modelBuilder doesn't correspond to the one that is created
- EntityFrameworkCore.DbUpdateException: Unable to delete row, SQL Syntax error
- Create one entity for multiple tables?
- I'm getting an error, when trying to communicate with db, it seems like something with verses, but I've already changed it and the error continues
- Issue with Entity Framework Core: .Include() and .AsNoTracking() not displaying expected related entities
- Entity Framework Core 8 throws "Method not found: 'Void CoreTypeMappingParameters..ctor" error
- EF Core is creating a table not in the migration
- Can I share a List<T> property across multiple queries via a tracking DbContext?
- Revert database context to previous state EF Core 7
Related Questions in DOMAIN-DRIVEN-DESIGN
- How to use Interfaces in Domain Modelling DDD
- Domain driven design CQRS with multiple aggregates and bounded context
- Need more parameters in subclass overridden method
- Domain Driven Design: Aggregates Creating Aggregates
- How to deal with objects creation per request with high RPM node applications
- Async integration events needed sync
- In DDD where to handle interaction with external services that is part of business logic? In Domain Model or in Command Handler?
- How to split large time-related aggregates in DDD?
- One column with foreign key to multiple tables inf EntityFramework Core
- DDD & Clean Architecture: Why not define repositories in the application layer?
- Domain driven design: How to add a new database entry for an Aggregate?
- Integrate a versioning in aggregate
- when to pass args to the constructor of a service in ts?
- ASP.NET boilerplate module's dbcontext recreate abp main tables
- What's wrong with multiple entities in multiple bounded contexts pointing to the same identity?
Related Questions in ABP
- One-to-one and many-to-one relationship in EF Core
- Create custom intereceptor for Abp dynamic C# client proxies
- How to get the current logged in userID in ABP - Angular?
- "Uncaught SyntaxError: Unexpected end of JSON input" when use DataTable in ASP.NET Boilerplate
- about the table of AbpUserLoginAttempts
- Disposing DbContext receiveed from UnitOfWorkManager
- Issue downloading file From Azure Blob using Blazor wasm (ABP.IO)
- How to remove preinstalled languages in ABP framework in microservice template?
- How to send request from Windows Service to ABP Framework?
- How can I suppress some of the "DBG" and "INF" messages output by the dotnet run command?
- abp framework return dto id in lowercase
- How to generate access token in backend only with user email?
- Error installing abp cli: source was found on
- Swagger Unable To Create Component in ASP.NET Zero .Net 7
- 403 and 401 errors in ABP Framework not returning response body
Related Questions in IREPOSITORY
- Eager load a single entity
- How to join two table with repository and service pattern
- Why mocking a Repository requires a virtual function and mocking IRepository overrides the existing function?
- Adding global session filter to repository entity
- Dependency Injection with GenericRepository error - No database provider has been configured for this DbContext NET.Core 3.1
- how to add scope if I use IService in Controller and connect Iservice in order as IService->Service->IRepository->Repository
- IRepository and Related Data?
- Having irrelevant extra parameters and DTO to impelememt IRepository in Domain layer
- Extending an Entity and using IRepository
- ASP.NET Boilerplate IRepository extension method
- Using the same class for Repository pattern and data handling in VM
- Error when trying to use EF Functions with Generic IRepository Pattern
- Can't use superclass in Repository implementation in PHP
- Constructors and Methods on POCO classes with the IRepository Pattern
- Determine which construtor to be called(change default constructor) when an action is called in MVC Web API
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Popular Tags
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Use dependency injection via constructor in your DbContext class. Set the currently selected UI language inside the class implementing the interface. Use the injected implementation in the OnModelCreating method to apply the filter globally with .HasQueryFilter() method like you normally would.
If you're using something like a .NET Core API, you could build a middleware that determines the language of the current incoming request. I guess the same will work for MVC too.