sjh37 / EntityFramework-Reverse-POCO-Code-First-Generator

EntityFramework Reverse POCO Code First Generator - Beautifully generated code that is fully customisable. This generator creates code as if you reverse engineered a database and lovingly created the code by hand. It is free to academics (you need a .edu or a .ac email address), not free for commercial use. Obtain your licence from
https://www.reversepoco.co.uk/
Other
711 stars 227 forks source link

Query Filters (Global Query Filters) #818

Closed SDKZA closed 1 year ago

SDKZA commented 1 year ago

Hi Everyone.

Just want to say long time user of Reverse POCO. Love it

Apologies if this has been posted and answered. I did try to find an answer.. but I'm missing it.

Question is. Global Query Filters. https://learn.microsoft.com/en-us/ef/core/querying/filters

Example :

modelBuilder.Entity<Blog>().HasQueryFilter(b => EF.Property<string>(b, "_tenantId") == _tenantId);
modelBuilder.Entity<Post>().HasQueryFilter(p => !p.IsDeleted);

Is there a way to implement query filters on Poco? I want to set Filters according to certain critera.

Thanks!

SDKZA commented 1 year ago

I think I solved it... https://github.com/sjh37/EntityFramework-Reverse-POCO-Code-First-Generator/wiki/Partial---Adding-extra-model-entites-to-generated-DbContext