I am creating an ASP.NET web API application that returns an Atom or RSS feed. To do this, it creates System.ServiceModel.Syndication.SyndicationFeedand the user MediaTypeFormatteris responsible for processing the HTTP Accept header, converting SyndicationFeedto Atom10FeedFormatteror Rss20FeedFormatter, and streaming the result into a response stream, So far so good.
My controller looks something like this:
public class FeedController: ApiController
{
public HttpResponseMessage Get ()
{
FeedRepository feedRepository = new FeedRepository ();
HttpResponseMessage <SyndicationFeed> successResponseMessage = new HttpResponseMessage <SyndicationFeed> (feedRepository.GetSyndicationFeed ());
return successResponseMessage;
}
}
What I would like to do is use the OData built-in query to filter my channel, but changing the return type of the method Get()to IQueryable<SyndicationFeed>, obviously, will not work, because it SyndicationFeeddoes not work to implement IQueryable.
Is there a way to use the OData inline query in a property IEnumerable<SyndicationItem>on SyndicationFeed?
source
share