Sort method versus OrderBy LINQ extension method

Posted by nmarun on ASP.net Weblogs See other posts from ASP.net Weblogs or by nmarun
Published on Mon, 20 Jun 2011 02:42:02 GMT Indexed on 2011/06/20 16:23 UTC
Read the original article Hit count: 368

Filed under:
|
|
I have a class Product with an Id and a Name as properties. There are multiple ways of getting a list of products to display in sorted/ordered fashion, say, by the Name of the product. The two I’m concerned about here are the Sort and the OrderBy extension method through LINQ and the difference between them. 1: public class Product 2: { 3: public int Id { get; set; } 4: public string Name { get; set; } 5: } Below is the list of products that I’ll be using and is defined somewhere in the Program.cs...(read more)

© ASP.net Weblogs or respective owner

Related posts about .NET

Related posts about c#