You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. We have a service that currently utilises the Dynamic EDM Model approach. I've been asked to look into adding support for some aggregation functionality (basic $apply groupby and aggregate sum & count). I've been able to integrate mapping the odata request and the requested aggregation onto our other back end service that the odata endpoint uses as its datasource OK. Where i've hit a problem is with then creating an EDMEntityObjectCollection (based on approach of the DynamicEdmModelCreation sample project) that generates what I believe to be a valid odata response.
Although its proved difficult to find a definitive answer, I assume the @odata.id property on every value item for this kind of request is required. Yet I can't seem to find a way of creating that property/value in an EdmEntityObject object. Any attempts at assigning a property of that name result in the following exception being thrown:
Microsoft.OData.ODataException: The property name '@odata.id' is invalid; property names must not contain any of the reserved characters ':', '.', '@'.
So is what i'm trying to do supported/possible with the current lib, or am I wasting my time by trying to do something that is not supported for the Dynamic EDM Model use case?
Creating a valid odata.context based on the request might also be a challenge, but i'll cross that bridge if and when i've resolved this @odata.id issue first!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi. We have a service that currently utilises the Dynamic EDM Model approach. I've been asked to look into adding support for some aggregation functionality (basic $apply groupby and aggregate sum & count). I've been able to integrate mapping the odata request and the requested aggregation onto our other back end service that the odata endpoint uses as its datasource OK. Where i've hit a problem is with then creating an EDMEntityObjectCollection (based on approach of the DynamicEdmModelCreation sample project) that generates what I believe to be a valid odata response.
To illustrate the issue i'm going to take the example for groupby from the oasis docs http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/cs01/odata-data-aggregation-ext-v4.0-cs01.html#_Toc378326304
In their case then the request
GET ~/Sales?$apply=groupby((Customer/Country,Product/Name), aggregate(Amount with sum as Total))
would returnAlthough its proved difficult to find a definitive answer, I assume the
@odata.id
property on every value item for this kind of request is required. Yet I can't seem to find a way of creating that property/value in an EdmEntityObject object. Any attempts at assigning a property of that name result in the following exception being thrown:Microsoft.OData.ODataException: The property name '@odata.id' is invalid; property names must not contain any of the reserved characters ':', '.', '@'.
So is what i'm trying to do supported/possible with the current lib, or am I wasting my time by trying to do something that is not supported for the Dynamic EDM Model use case?
Creating a valid odata.context based on the request might also be a challenge, but i'll cross that bridge if and when i've resolved this @odata.id issue first!
Beta Was this translation helpful? Give feedback.
All reactions