0

I am attempting to query my WebAPI thus:

http://localhost/api/channels?$expand=ScheduleMetadatas&$filter=ScheduleMetadatas/any(ScheduleMetadata: ScheduleMetadata/StartDateTime gt datetime'2013-12-06T00:00:00.00')

however the query is not filtering as expected, it simply returns all child ScheduleMetadata entities for each channel entity.

what am I missing?

John
  • 1,714
  • 21
  • 41

1 Answers1

1

You are selecting all channels, that had at least one Schedule metadata which is before a certain date. Form the channel that match it will return all schedules no matter the filter

Rolfvm
  • 336
  • 2
  • 9
  • is it possible to get what I want? – John Dec 08 '13 at 16:07
  • I think you should look at it the other way around. So doing a query on the schedule meta data. Or YouTube can add an extra parameter on the uri which filters the meta data. – Rolfvm Dec 11 '13 at 11:07
  • 1
    Like : public void Get([Fromuri]DateTime metadatadatefilter) { return Context.Channel.Select(c => new Channel { Id = c.Id, Schedules = c.Schedules.Where(a => a.Date < metadatadatefilter), etc... }) } – Rolfvm Dec 11 '13 at 11:12