Generating sequence of Numbers using Linq.

Public Ienumerable BuildIntegerSequence()


var integers=Enumerable.Range(0,10); //0…9

var integers=Enumerable.Range(0,10).Select(i => 5+(10*i)); // 5,15,25…

return integers;


By Sriramjithendra Posted in LINQ

Anonymous Types in C#

The Anonymous types feature was introduced in version 3.0 of the C# language with a special purpose in mind and that purpose was to provide an easier way to define objects with a few read-only properties.

In the traditional way, we need to create a class and define read-only properties of the class and that’s it. Nothing more. So the C# development team added anonymous types to avoid the need for definition of the classes. The C# compiler understands when an anonymous type is defined. Each property of the class is inferred by the compiler.  Continue reading