Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Hi Dennis,

I'm not totally sure on this one, as I don't have more details about the Db-object, but I assume it's just a DataContext. In that case queries like e.g. ReadList() return an IEnumerable<T>. That means a OrderBy-statement after ReadList(proc, Make, parms) would just adjust your actual query string for a db-query (when it is actually done).

An example for a OrderBy is include in the sample-sourcecode below.

Regards
Florian



public class Contact
{
   int Id = 0;
   string Name = string.Empty;
}

var result = Db.ReadList(proc, Make, parms)
               .Cast<Contact>()
               .OrderBy(x => x.Name)           // add order statements to query
               .ToList();                      // execute actual query

 
Florian Schaeffler, Apr 03, 2012
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas