zzzprojects / EntityFramework.DynamicFilters

Global filtering for Entity Framework.
https://entityframework-dynamicfilters.net/
MIT License
501 stars 87 forks source link

[Oracle EF] Added Dynamic Filter to existing table #150

Closed KennyEng12 closed 2 years ago

KennyEng12 commented 5 years ago

Hi @jcachat @stgelaisalex @jaenyph @JonathanMagnan @waqasm78 , I'm using Dynamic Filter for Oracle EF.

I'm having an issue, which is same with #54. But I don't want to delete all previous migrations and create a new initial migration.

I'm wondering if there any solutions for this issue without delete all previous migrations and create a new initial migration?

Thanks. Kenny

JonathanMagnan commented 5 years ago

Hello @KennyEng12 ,

Unfortunately there is no other fix that I know ;(

Best Regards,

Jonathan

tom177y commented 5 years ago

Hi Jonathan,

It means the only way to resolve this issue is to ensure Dynamic Filter is applied at the time of table creation with reference to #54.

Any plan to rectify this shortcoming for applying Dynamic Filter on existing Oracle tables?

Best regards, Tommy

JonathanMagnan commented 5 years ago

Hello @KennyEng12 , @tom177y ,

If you can provide a "working" project with this issue, I will assign a developer a few hours to look at it to see if he can find something. Perharps he will find a solution to it.

If you need to send in it private, you can send it here info@zzzprojects.com

KennyEng12 commented 5 years ago

Hi @JonathanMagnan ,

Here is the: Sample Project

I've implemented DynamicFilter in ~/Models/IdentityModels.cs (ApplicationDbContext class).

Thanks, Kenny

JonathanMagnan commented 5 years ago

Thank a lot @KennyEng12 ,

We will look at it.

Best Regards,

Jonathan

KennyEng12 commented 5 years ago

Thank you @JonathanMagnan ,

Hope can get a solution from you.

Thanks, Kenny

tom177y commented 5 years ago

Hi @JonathanMagnan,

Wondering if there is any update on this issue?

Thanks. /Tommy

JonathanMagnan commented 5 years ago

Hello @tom177y , @KennyEng12 ,

Unfortunately, my developer tried last week and a few hours this week without any progression.

So we will have to abandon it for now until we discover something that could lead us to a solution on this one.

KennyEng12 commented 5 years ago

Hi @JonathanMagnan ,

Thanks for helping us to discover.

So I will leave this OPEN until your team discover something?

Thanks, Kenny.

JonathanMagnan commented 5 years ago

Hello @KennyEng12 ,

Yes, keep it open.

We need often to play directly in the EF6 source code when developing some feature in EF Classic, so we will try to keep this migration issue in mind when we will do something on it.

worthy7 commented 5 years ago

Hi everyone, I want to let you know that I have confirmed a bug in Oracle's SQL Generator for EF when using "AlterTableAnnotations" in a migrations. That is the source of this bug and is not related to just EF.DF. (on CreateTable is fine, but another confusing point is that the error for AlterTableAnnotations says CreateTable which is wrong)

(proof: https://github.com/Worthy7/OracleTestAlterTableAnnotations)

There is no fix for this right now, I don't actually fully understand what "annotations" are on a table to be honest, I don't understand how it affects anything since no SQL is generated, but, please confirm @JonathanMagnan , I think you can just delete any AlterTableAnnotations from your migrations to keep Oracle quiet.

worthy7 commented 2 years ago

Hi everyone, I want to let you know that I have confirmed a bug in Oracle's SQL Generator for EF when using "AlterTableAnnotations" in a migrations. That is the source of this bug and is not related to just EF.DF. (on CreateTable is fine, but another confusing point is that the error for AlterTableAnnotations says CreateTable which is wrong)

(proof: https://github.com/Worthy7/OracleTestAlterTableAnnotations)

There is no fix for this right now, I don't actually fully understand what "annotations" are on a table to be honest, I don't understand how it affects anything since no SQL is generated, but, please confirm @JonathanMagnan , I think you can just delete any AlterTableAnnotations from your migrations to keep Oracle quiet.

just wondering if this ever got answered? After (https://github.com/zzzprojects/EntityFramework.DynamicFilters/issues/153) was fixed I could get migrations generating from initialMigration again, but this annoying problem popped up instead.

I believe the issue is caused by DF trying to do an "AltertableAnnotations", can it somehow be removed without reprecussion?

JonathanMagnan commented 2 years ago

Hello @worthy7 ,

If there is something, I believe this would be on this line: https://github.com/zzzprojects/EntityFramework.DynamicFilters/blob/master/src/EntityFramework.DynamicFilters.Shared/DynamicFilterConvention.cs#L28

We will look deeper next week

worthy7 commented 2 years ago

Yes I would agree - to b honest it's really oracle's issue but they are pretty much refusing to fix it (I logged a bug in 2019). What is this code for? How to annotations help DF?

On Wed, 22 Sept 2021 at 23:10, Jonathan Magnan @.***> wrote:

Hello @worthy7 https://github.com/worthy7 ,

If there is something, I believe this would be on this line: https://github.com/zzzprojects/EntityFramework.DynamicFilters/blob/master/src/EntityFramework.DynamicFilters.Shared/DynamicFilterConvention.cs#L28

We will look deeper next week

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/zzzprojects/EntityFramework.DynamicFilters/issues/150#issuecomment-924969624, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABEKWH5X5MULNY76KG42A33UDHPWZANCNFSM4GOUDTMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

JonathanMagnan commented 2 years ago

Will be able to answer you soon ;) I should investigate it at the beginning of next week.

If I don't find any good reason, I will just add an option to allow you to disable this part of the code

JonathanMagnan commented 2 years ago

Hello @worthy7 ,

The annotation is used to later be able to catch later the filter configuration through the metadata property. For example, here: https://github.com/zzzprojects/EntityFramework.DynamicFilters/blob/master/src/EntityFramework.DynamicFilters.Shared/DynamicFilterQueryVisitorCSpace.cs#L280

So that's pretty much the core logic of how the DF library is working and would be very hard to remove.

Unfortunately, we cannot remove it without repercussion. It will require us way too much code rewrite doing something like this.

Not the answer you wished but at least we now know that doing this request will require too much effort.