RemoteTable<Customers> OurCustomers = linqRemoteDataAdapter.GetTable<Customers>();
var aList = from cust in OurCustomers
where (cust.City == "México D.F.")
orderby cust.ContactName ascending
select new { cust.CustomerID, cust.ContactName, cust.Address, cust.City };
Or if you prefer dot notation:
RemoteTable<Customers> OurCustomers = linqRemoteDataAdapter.GetTable<Customers>();
var aList = OurCustomers
.Where(cust => cust.City == "México D.F.")
.OrderBy(cust => cust.ContactName)
.Select(cust =>
new { cust.CustomerID, cust.ContactName, cust.Address, cust.City });
So if you're using DALinq in RemObjects DataAbstract for your n-tier framework you can use either the GetTable syntax or create a variable and do it more like the books present examples with LINQ to Objects.
About The Author
Ron Grove draws on over ten years of training, network administration and development experience. He loves to work with new technology and see how that technology can be best utilized by his clients. You can find him through his company Evanoah, LLC and his LinkedIn profile is here.
0 comments:
Post a Comment