I am populating my custom appointments in the following manner via DataServiceQuery
I need to make the .Where dynamic. I have an ObservableCollection that I'm pulling information out of similar to this:
I need to conditionally add items to the where clause that are coming from this foreach loop. I'm having issues dynamically adding information to the .Where section of the DataServiceQuery.
What is the best way to do this?
Tim
DataServiceQuery<
customAppointment
> query;
query = (DataServiceQuery<
customAppointment
>)myContenxt.customAppointmentSet
.AddQueryOption("$select", "field1,field2,field3,field4")
.AddQueryOption("$orderby", "field3")
.Where<
customAppointment
>(a => (a.field3.Value >= start && a.field3 <= end) && (a.field4.Value == 0 || a.field4.Value == 3));
I need to make the .Where dynamic. I have an ObservableCollection that I'm pulling information out of similar to this:
foreach (ResourceItem r in resourceItemList)
{
if (r.IsSelected)
{
// build where clause
}
}
I need to conditionally add items to the where clause that are coming from this foreach loop. I'm having issues dynamically adding information to the .Where section of the DataServiceQuery.
What is the best way to do this?
Tim