Sorting is one of the most basic and essential algorithm form the early days of computation, In this article we will be discussing about sorting a list of items in a web application, this is one of the common feature given to the administrators, for example sorting the products in an e-commerce application, FAQ list etc etc, I am using the feature list as an example, typically this will be like features of a product which a web admin would like to sort.

 

Code:

Lets start by opening an ASP.net MVC application.

TDD:

ASP.net MVC gives a lot of emphasis on test driven development and its always a good practice to write a test before implementing any solution which will serve as a guideline for us at the time of implementing the functionality so lets add a test which will ensure that all the items are sorted according to their position after the list is sorted.

More...

Currently rated 4.8 by 4 people

  • Currently 4.75/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Anonymous Types

Published 11/13/2008 by Rony in Technology | C# | LINQ
Tags: ,

Anonymous Types are inline class definition which is created at compile time, we use the same syntax of Object Initializer to declare a Anonymous Types but with out the class name

var customer = new {Name = "Paolo Accorti", Country = "Italy"};

 

In my previous post about Local Type Inference we discussed about the var keyword and how it provides us a relaxed way of declaring variable but in the case of Anonymous Types the usage of the var keyword is a must to assign it to a variable. Anonymous Types is a very handy tool when when we handle data using LINQ More...

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5