Since ASP.Net 2012.2 was released I have been attempting to create a Web API which returns OData which in turn can be consumed by PowerPivot. I have this working with a predefined model.
However I have a scenario whereby I will not know the number of properties prior to the request being made. What I would like to do is be able to execute a stored procedure to get a DataTable and be able to return the contents of this DataTable as odata.
My initial attempts with returning an IQueryable<DataRow>
ended up with the following response.
Response, Status=406 (NotAcceptable), Method=GET, Url=http://localhost:43438/odata/Products, Message='Content-type='none', content-length=unknown'
I have since attempted to use ExpandoObject
to create a dynamic object to represent the contents of the DataTable however this also gives the response above.
Is there a feasible way to use a dynamic number of properties and serialize this to OData?