Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HasQueryFilter not working from Entity Framework Core 3.0 Preview 6 #16139

Closed
tallichet opened this issue Jun 18, 2019 · 3 comments
Closed

HasQueryFilter not working from Entity Framework Core 3.0 Preview 6 #16139

tallichet opened this issue Jun 18, 2019 · 3 comments

Comments

@tallichet
Copy link

I have updated a project (blazor server side using EF Core 3) from preview 5 to preview 6. Since then, my QueryFilters are not working any more.
My database context are registered as transcient.

The code is has follows:

private void SetQueryFilter(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Contact>().HasQueryFilter(c => !c.Deleted && c.TenantId == _tenantId);
}

The SetQueryFilter is called from OnModelCreating. _tenantId is set in the ctor.

The methods also seems to be called only once.

@tallichet
Copy link
Author

And yes, my code was working correctly using Entity Framework Core 3.0 Preview 5

@smitpatel
Copy link
Contributor

Duplicate of #15264

@smitpatel smitpatel marked this as a duplicate of #15264 Jun 18, 2019
@ajcvickers
Copy link
Contributor

@tallichet First, many thanks for trying preview 6. We really appreciate people trying the previews and filing issues on what they find.

If you haven't seen it already, there is some good information in the preview announcement post about the changes that are happening to LINQ queries for EF Core 3.0. Preview 6 is the first release containing these changes, which means we are both expecting things to be broken, but at the same time very grateful for everyone who tries the release and generated feedback.

Support for query filters was not completed for preview 6. Closing this as a duplicate of #15264

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants