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

Local Type Inference - var keyword

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

Type Inference is one of the important features for a dynamic language; it preserves type safety while allowing you to write code with more ease. The compiler has the built-in intelligence to determine the “Type” of a variable.
There is always an argument about code readability when it comes to dynamic type inference, but when we work with external APIs and language features like LINK this becomes very handy tool, and it helps us to keep up with the design principle “Program to an Interface, not an implementation”
The keyword “var” is used to denote the complier that you are declaring a dynamic type inference variable. More...

Currently rated 5.0 by 1 people

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

LINQ: Introduction

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

What is LINQ

LINQ is a uniform programming model for any kind of data. LINQ enables you to query and manipulate data with a consistent model that is independent from data sources.

LINQ stands for Language Integrated Query

LINQ can be used to query against any kind of data collection like Database, XML file, ADS and so on, technically speaking any class that implements the IEnumerable or IQueryable interface to know about the difference between these two interfaces kindly visit my post More...

Currently rated 5.0 by 1 people

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