New to OData and I have a question I cannot seem to find a solid solution for. I admit this might just be info overload and I cannot find the right path. So I am looking for at least a path forward.
I have OData wired up and working. Middleware and configuration all setup and initialized. I can run test queries against some endpoints. My issue is with the types my endpoints return. We are wrapping our result objects with some additional information. There is a ResponseList
object that contains an IEnumerable<T>
with the data returned as well as some additional information for the response. This ResponseList
is just a wrapper.
public class ResponseList<T>
{
public ResponseList(IEnumerable<T> data, string extraInfo = null)
{
Data = data;
ExtraInfo = extraInfo;
}
public IEnumerable<T> Data { get; set; }
public string ExtraInfo { get; set; }
}
My endpoints will return the ResponseList<ReturnItems>
and OData will show the object. Yet I don't care about the ExtraInfo
stuff and only the IEnumerable<ReturnItems>
information.
How can I setup EDM or define this model type to return only that info?