{"action":"created","issue":{"url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/47","repository_url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET","labels_url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/47/comments","events_url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/47/events","html_url":"https://github.com/zzzprojects/Eval-Expression.NET/issues/47","id":377876382,"node_id":"MDU6SXNzdWUzNzc4NzYzODI=","number":47,"title":"Querying dynamic data with generated LINQ queries","user":{"login":"TehWardy","id":6891030,"node_id":"MDQ6VXNlcjY4OTEwMzA=","avatar_url":"https://avatars3.githubusercontent.com/u/6891030?v=4","gravatar_id":"","url":"https://api.github.com/users/TehWardy","html_url":"https://github.com/TehWardy","followers_url":"https://api.github.com/users/TehWardy/followers","following_url":"https://api.github.com/users/TehWardy/following{/other_user}","gists_url":"https://api.github.com/users/TehWardy/gists{/gist_id}","starred_url":"https://api.github.com/users/TehWardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehWardy/subscriptions","organizations_url":"https://api.github.com/users/TehWardy/orgs","repos_url":"https://api.github.com/users/TehWardy/repos","events_url":"https://api.github.com/users/TehWardy/events{/privacy}","received_events_url":"https://api.github.com/users/TehWardy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"JonathanMagnan","id":23240780,"node_id":"MDQ6VXNlcjIzMjQwNzgw","avatar_url":"https://avatars0.githubusercontent.com/u/23240780?v=4","gravatar_id":"","url":"https://api.github.com/users/JonathanMagnan","html_url":"https://github.com/JonathanMagnan","followers_url":"https://api.github.com/users/JonathanMagnan/followers","following_url":"https://api.github.com/users/JonathanMagnan/following{/other_user}","gists_url":"https://api.github.com/users/JonathanMagnan/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanMagnan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanMagnan/subscriptions","organizations_url":"https://api.github.com/users/JonathanMagnan/orgs","repos_url":"https://api.github.com/users/JonathanMagnan/repos","events_url":"https://api.github.com/users/JonathanMagnan/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanMagnan/received_events","type":"User","site_admin":false},"assignees":[{"login":"JonathanMagnan","id":23240780,"node_id":"MDQ6VXNlcjIzMjQwNzgw","avatar_url":"https://avatars0.githubusercontent.com/u/23240780?v=4","gravatar_id":"","url":"https://api.github.com/users/JonathanMagnan","html_url":"https://github.com/JonathanMagnan","followers_url":"https://api.github.com/users/JonathanMagnan/followers","following_url":"https://api.github.com/users/JonathanMagnan/following{/other_user}","gists_url":"https://api.github.com/users/JonathanMagnan/gists{/gist_id}","starred_url":"https://api.github.com/users/JonathanMagnan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JonathanMagnan/subscriptions","organizations_url":"https://api.github.com/users/JonathanMagnan/orgs","repos_url":"https://api.github.com/users/JonathanMagnan/repos","events_url":"https://api.github.com/users/JonathanMagnan/events{/privacy}","received_events_url":"https://api.github.com/users/JonathanMagnan/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-11-06T14:41:03Z","updated_at":"2018-11-15T14:46:34Z","closed_at":null,"author_association":"NONE","body":"Hey @JonathanMagnan,\r\n\r\nHere's some more detail on an issue i'm having which relates closely to #44 but I didn't feel right in canabalizing @tomasceleda's issue for my own problem (feel free to close and merge if you think these are the same problem though).\r\n\r\nI put together a fiddle (seems to be the best way to hand over a complete \"working\" sample of the problem ...\r\n\r\nhttps://dotnetfiddle.net/ZZ4V1B\r\n\r\n... In the sample you can see that I can \"manually execute the query\" but I can't dispatch the same code to Eval.Execute() for some reason.\r\n\r\ntestResult = ... on line 73 of the code sample runs fine.\r\nGiven the same code to Eval.Execute() as a string on line 102 it fails with a strange exception I don't understand how to parse."},"comment":{"url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/comments/439064552","html_url":"https://github.com/zzzprojects/Eval-Expression.NET/issues/47#issuecomment-439064552","issue_url":"https://api.github.com/repos/zzzprojects/Eval-Expression.NET/issues/47","id":439064552,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTA2NDU1Mg==","user":{"login":"TehWardy","id":6891030,"node_id":"MDQ6VXNlcjY4OTEwMzA=","avatar_url":"https://avatars3.githubusercontent.com/u/6891030?v=4","gravatar_id":"","url":"https://api.github.com/users/TehWardy","html_url":"https://github.com/TehWardy","followers_url":"https://api.github.com/users/TehWardy/followers","following_url":"https://api.github.com/users/TehWardy/following{/other_user}","gists_url":"https://api.github.com/users/TehWardy/gists{/gist_id}","starred_url":"https://api.github.com/users/TehWardy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TehWardy/subscriptions","organizations_url":"https://api.github.com/users/TehWardy/orgs","repos_url":"https://api.github.com/users/TehWardy/repos","events_url":"https://api.github.com/users/TehWardy/events{/privacy}","received_events_url":"https://api.github.com/users/TehWardy/received_events","type":"User","site_admin":false},"created_at":"2018-11-15T14:46:34Z","updated_at":"2018-11-15T14:46:34Z","author_association":"NONE","body":"Hi @JonathanMagnan,\r\n\r\nthanks for keeping me up to date.\r\n\r\nInterestingly enough ... i have the same problem in our front end code that will be providing the metadata to the code that generates the code i feed in to your library.\r\n\r\nI think the issue is in .Nets handling of the generic when used like this ...\r\n\r\n`Foo<dynamic> `\r\n\r\n... When the receiver is given that if you use reflection to get the type information you actually get back the same as if you did ...\r\n\r\n`var type = typeof(object);`\r\n\r\n... With ExpandoObjects however you can basically say that typeof(ExpandoObject) will automatically be mapped to dynamic variables to force the compiler to treat the object as dynamic.\r\n\r\nFor example ...\r\n```\r\nvar x = new Message<object>();\r\nvar genericType = x.GetType().GetGenericArguments()[0];\r\n\r\nif (genericType == typeof(ExpandoObject))\r\n{\r\n    dynamic y = x;\r\n}\r\n```\r\n... from that point on the variable y is a dynamic version of x and the compiler will allow you to do dynamic things with it but consuming x in the same way is not allowed.\r\n\r\nI also found from the stack overflow issue that Jon Skeet pointed out when you have a dynamic variable that has a non dynamic property, in the compiler you're still working within a dynamic sub context weather you like it or not, the fact is there are no \"compile time checks\" that the compiler can actually do past the point you start consuming any var declared as \"dynamic something =\".\r\n\r\nFor my code to work, i took on this assumption whenever I saw something that was of type object or ExpandoObject and the net result was that my code worked but it meant that I had to take responsibility for making sure my dynamic code was correct before making the call.\r\n\r\nIt's also why i had to the JSON dance on line 119 of my example on the fiddle.\r\nsince json is just a string and how it's interpretted is down to how I call the json converter it's my call to turn the dynamic result in to something concrete where I know that the conversion can be made, but only when that's true.\r\nIn the scenario where it isn't i return a dynamic result which follow on code interprets as \"typeof(object)\" weather i like it or not.\r\n\r\n I hope this helps, shout if there's anything else I can offer you I learned a ton by digging through the roslyn code and by picking Jon Skeets brains over the past 4 or 5 years on this exactly problem as pretty much everything we do ends up in this kind of problem.\r\n\r\nFunnily enough ... my dependency on Eval here was me thinking \"lets make this issue permanently someone elses problem\" ... I should have known better ;)"}}
{"actor":{"display_login":"TehWardy"}}