Through the Domain Model, Telerik Data Access exposes entities as objects and with the support of the LINQ
by OpenAccessContext, you can write queries directly against the database. This means that if you want to select only a set of entities from the database which meet some criteria, you can use LINQ to the context endpoints and the select statement will be executed on the server.
You can find my answers for each of the posted questions below:
Q) How do I query, say, a distinct list of Cities from a table called CityCountyState with three columns (City, Count, State).
A) If the domain class is named "CityContyState" and the endpoint in the context is CityContyStates:
var cities = context.CityContyStates.Select(c => c.City).Distinct();
Q) If I know the City starts with "Ab" and the County has the letters "tr" somewhere in the string, how do I query that instead of the entire list?
var result = context.CityContyStates.Where(c => c.City.StartsWith(
) && c.County.Contains(
I hope that helps.
OpenAccess ORM is now Telerik Data Access
. For more information on the new names, please, check out the Telerik Product Map