LINQ Queries
Below are examples of LINQ queries supported by the provider.
Retrieve and Search for Records
The following query searches for records that have a value of "Checking" for the acctName column.
var query = from Account in context.Account
where Account.acctName == "Checking"
select Account;
Contains
You can also search for strings within strings: The following example retrieves all Account entities with a value that contains "B" in the acctName column.
var query = from Account in context.Account
where Account.acctName.Contains("B")
select Account;
Limit
The following example limits the results returned to 10.
var query = (from Account in context.Account
orderby Account.acctName descending,
Account.AcctName ascending
select Account).Take(10);
Count
The following example counts all entities that match a given criterion.
var query = (from Account in context.Account
where Account.acctName == "Checking"
select Account).Count();