Developer

Binding Responses to UI Controls Using LINQ

Use Language-Integrated Query (LINQ) to bind a response to a UI control.

Context

LINQ allows you to manipulate the ODataEntitySet, and write complex filters. See http://msdn.microsoft.com/en-us/library/bb552413(v=vs.110).aspxInformation published on non-SAP site.

Procedure

Use LINQ to filter the ODataEntitySet (using either lambda expression or SQL), then display the results:
// LINQ extension method using the lambda style
var filteredEntitySet = entitySet.Where(e => ((string)e.Properties["Address/State"].Value) == "WA");

// LINQ extension method using the SQL style
var filteredEntitySet = from e in entitySet
where ((string)e.Properties["Address/State"].Value) == "WA"
                        select e;

foreach (var e in filteredEntitySet) 
{
    Console.WriteLine(e.Properties["Name"].Value);
}