System.Linq.Dynamic.Core icon indicating copy to clipboard operation
System.Linq.Dynamic.Core copied to clipboard

DefaultDynamicLinqCustomTypeProvider Issue

Open nmadland opened this issue 2 years ago • 7 comments

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

We recently upgraded this package from version 1.3.12 to 1.4.3, and suddenly started getting the below exception.

2. Exception

If you are seeing an exception, include the full exception details (message and stack trace).

Exception while parsing expression `true` - Method not found: 'Void
System.Linq.Dynamic.Core.CustomTypeProviders.DefaultDynamicLinqCustomTypeProvider..ctor(Boolean)'.

3. Fiddle or Project

Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.

4. Any further technical details

It appears to be part of this commit possibly - https://github.com/zzzprojects/System.Linq.Dynamic.Core/commit/852434ce03e318a45b4fb5fd0a656e7d9bab989c#diff-59a013aa11deb1923983dd1185ff649c2c327d2841621d18dff2991ebbef6d6d

It looks like in version 1.4.3, a constructor parameter was added for a parsing config object. Is there a way for you to make this nullable or optional, or to use an empty default assembly helper like before, if no parsing config is passed in?

But we were hoping that since we didn't have issues with the previous version that we wouldn't have to make a change on our side, beings this is not a major version upgrade in the package. Do you happen to have any capacity to address this please?

Thank you.

nmadland avatar Jul 24 '24 13:07 nmadland

I can try to make the config a nullable argument.

However I wonder why you get this exception? I would expect that you get a an error at build-time?

StefH avatar Jul 29 '24 06:07 StefH

Upon looking at things closer on my side, we are using the SLDC package through the RulesEngine package. We are running version 5.0.3 of that. That version states that it requires an SLDC dependency >= 1.3.7. I would think RulesEngine should still work using SLDC 1.4.3?

nmadland avatar Jul 29 '24 13:07 nmadland

I would think RulesEngine should still work using SLDC 1.4.3?

I do not think so, can you create an issue on the RulesEngine repo?

StefH avatar Jul 29 '24 15:07 StefH

Yes sure thing. Thank you.

nmadland avatar Jul 29 '24 16:07 nmadland

There still is the issue that the latest SLDC has a breaking change in the DefaultDynamicLinqCustomTypeProvider class. I think it would be beneficial to allow consumers to keep using the old constructor with the understanding it's deprecated. It just makes for a sub-optimal experience when a breaking change is introduced when it's not expected. Great library and thank you!

nmadland avatar Jul 29 '24 16:07 nmadland

https://github.com/zzzprojects/System.Linq.Dynamic.Core/pull/833

I think this PR should fix it. Can you verify the code?

StefH avatar Jul 29 '24 18:07 StefH

Thanks @StefH that did resolve the issue .

ivansager avatar Aug 07 '24 02:08 ivansager