question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for IndexExpression

See original GitHub issue

Is your feature request related to a problem? Please describe.

I have an expression that uses a dictionary. But I can’t serialize it as Serialize.Linq do not support IndexExpression.

Describe the solution you’d like

Suport for IndexExpression so that something like:

Expression<Func<Dictionary<string,string>, bool>> filterExpression = filter => (int)Convert.ChangeType(filter["Age"], typeof(int)) < 10;

can be serialized.

Background

I’m building a messaging system where developers may filter messages using LINQ expressions.

A dev might use something like: subscription.Filter<MyDTO>(x => x.Age < 10).

But since the messaging system doesn’t have access to the assembly that the MyDTO type is located in I’m transforming the expression to use a Dictionary<string,string> instead before transferring the expression to the messaging system.

That’s why I have wierd looking expressions 😃

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jgauffincommented, Sep 18, 2019

It works fine. Thank you for the help!

0reactions
jgauffincommented, Sep 10, 2019

yes, I will check tomorrow. thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

IndexExpression Class (System.Linq.Expressions)
Gets the arguments that will be used to index the property or array. CanReduce. Indicates that the node can be reduced to a...
Read more >
IndexExpression.cs
... 4.8 Download Feedback License Help. File: Microsoft\Scripting\Ast\IndexExpression.cs. Project: ndp\fx\src\Core\System.Core.csproj (System.Core) ...
Read more >
c# - IndexExpression to MemberBinding
I have an issue which I need some help with. There is an object say TestObject public class TestObject { public int Value...
Read more >
()-indexing must appear last in an index expression. in ...
Hi, I'm currently doing my final project using matlab. And I found this: ()-indexing must appear last in an index expression. when running ......
Read more >
The end operator must be used within an array index ...
The end operator must be used within an array index expression ... Find more on Matrices and Arrays in Help Center and File...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found