This project is read-only.

Will the QueryTranslator support dynmic objects?

Topics: Web Api
Apr 2, 2011 at 3:59 AM
Edited Apr 2, 2011 at 3:59 AM

Anyone happen to know if the Microsoft.QueryComposition.dll library is intended to support Dynamic objects?  Below I have isolated the call that the [QueryComposition] code runs through.  I consistently get an error when trying to use an IQueryable of dynamic objects.  Is the intent that dynamic objects should be supported?



var listofDynamics = new List<dynamic>();
dynamic testone = new ExpandoObject();
testone.Name = "Bob";
testone.Age = 54;
dynamic testtwo = new ExpandoObject();
testtwo.Name = "Sally";
testtwo.Age = 22;
var filteredList = QueryTranslator.Translate(listofDynamics.AsQueryable(), "http://localhost?$filter=Age gt 30");

//Error: Bad request: Invalid Could not retrieve Age from the instance.Type

Apr 4, 2011 at 12:13 AM

The current bits (which are an early prototype) do not support this. We have newer bits coming, but I am not sure that this is a design goal. I will find out.



May 25, 2011 at 10:33 AM

Is there any update on this topic?

Is there a way to counter this, or to implement something of our own to translate the query?