-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
Dynamic.DynamicIndex is exposed in the expression #448
Comments
Hello @hazzik, thanks for reporting. I'll take a look. |
@hazzik |
It is here: public class Product
{
public virtual string ProductId { get; set; }
public virtual dynamic Properties { get; set; }
}
public void Query_DynamicComponent()
{
using (var session = OpenSession())
{
var product = session
.Query<Product>()
.Where("Properties.Name == @0", "First Product") // <-- here
.Single();
Assert.That(product, Is.Not.Null);
Assert.That((object) product.Properties["Name"], Is.EqualTo("First Product"));
Assert.That((object) product.Properties.Name, Is.EqualTo("First Product"));
}
} |
This is the simplest reproduction: https://dotnetfiddle.net/8Az1F6 It outputs
And |
Hello @hazzik, |
Dear @hazzik , can you please provide a minimal console-app to reproduce this issue? |
I'll do it on or by this weekend. |
@StefH here is the console app with reproduction: https://github.com/hazzik/nhibernate-linq-dynamic |
@hazzik Thank you very much, I'll copy this example to verify/reproduce the bug. |
This code was working fine in 1.1.8. I know that dynamic expressions are supported in the linq-tree, but not supported on a language level. To properly support them it would probably be required to depend on Microsoft.CSharp package. |
@hazzik However it seems that 1.1.7 does work, and higher versions fail with: Correct ? |
Yes, that is correct. I might misremembered the working version due it is being long time since I've tested it myself. |
Hello @hazzik , did you have time to test this preview package? |
Hello @hazzik, Thanks a lot for your analysis and help. In some day(s) , I'll merge this PR and create a new official 1.2.8 NuGet package |
After upgrading from 1.1.8 to 1.2.0 I'm getting MethodNotSupported exception because my expression parser finds
Dynamic.DynamicIndex(object, string)
method in the expression. Strangely this method was introduced in 1.1.8, but the error started happening only in 1.2.0Here are the failing tests: https://ci.appveyor.com/project/hazzik/nhibernate-core/builds/35962348/job/uvi4bg3jew1giw41/tests
The text was updated successfully, but these errors were encountered: