danroth27 wrote:Why bother with your own formatter? Why not just use the OData formatter for you JSON and XML representation?
Apparently I'm missing something here. All these new webapi and odata things are very new to me. From the preview on, I liked it because i could dynamicaly query my entities with a very simple REST service and a filter statement, just by adding an [queryable] attribute or thru odatasetting/odataresult if I wanted more control. I read about top and skip for paging and was even happier. Then I read that inlinecount had been added to the source to make (for me) paging really usefull.
I know output can be changed to json or xml by specifying it in the request., but now you talk about an odataformatter that also outputs xml or json.
I'm confused, I expected that with inlinecount added I had something to put in the third parameter for odataresult. Can you enlighten me some more?
public ODataResult<Resource> Get(ODataQueryOptions options) {var results = (options.ApplyTo(entities.Resources) as IQueryable<Resource>);returnnew ODataResult<Resource>(results, new Uri("http://nextpage"), "what goes here? Request.GetInlineCount()?"
); }