0

I am trying to get dynamic expresso to interpret this line of code:

(((IDictionary<string, object>)o)["Diesel % in oil"].ToString().StartsWith("<") ? ((IDictionary<string, object>)o)["Diesel % in oil"].ToString().Replace("<", String.Empty) : ((IDictionary<string, object>)o)["Diesel % in oil"].ToString())

When it executes I get the following exception Unknown identifier 'IDictionary' (at index 3).

I am testing for a "<" at the start and then replacing all instances of the "<" (excuse the terrible key name - out of my control that one!).

I have tried adding typeof(System.Collections.Generic.IDictionary<string, object>) as a reference to the interpreter object, but no joy.

I'm sure I'm missing something simple.

TechyGypo
  • 824
  • 1
  • 11
  • 27
  • I suggest to post the question on github, where we are more active: https://github.com/dynamicexpresso/DynamicExpresso/issues . But I suspect that `IDictionary` is not know as type, but you can add it. – Davide Icardi Nov 20 '22 at 11:26
  • @DavideIcardi Will do! I posted on SO as that's what was suggested in the wiki [https://github.com/dynamicexpresso/DynamicExpresso/wiki](https://github.com/dynamicexpresso/DynamicExpresso/wiki) – TechyGypo Nov 22 '22 at 09:04

0 Answers0