Archive of ‘C#’ category

C# 7 features overview

C# 7 added some new features with a focus on code simplification and performance. This post explains C# 7 new features
Binary Literals

We now have binary literals like 0b followed by 0’s and 1’s; literals can often get longer so you can add underscore to separate them as shown in above screenshot.
Install-Package “System.ValueTuple”
One of the major […]

C# 6.0 Features overview

This post outlines the new features that are added to the C# new version 6.0.
Enhancement to Auto Properties:  currently auto properties are needed to have setters. This puts disadvantage to immutable data types. Now C# 6 allows only getters on auto properties.C# 6 also   allows initializers to auto properties as shown in the following […]

Immutable Collections in .NET Framework

What are Immutable Collections?
Immutable Collections are collections which guarantees that they never change their content and completely thread safe. Immutable suggests that data will not change and will not ever change and moreover you can hold a reference to it as long as you want. Why should we use Immutable Collections when there are Readonly […]

Asynchronous Lambda Expressions in C#5

Asynchronous functions make asynchronous programming similar to synchronous programming. You can read my previous post on C# 5.0 features. Normal methods can written as asynchronous as shown below

1: async Task Demo()

2: {

3: await Task.Delay(10000);

4: Console.WriteLine(“Hello World!!”);

5: }

You can call the […]

What is new in C# and Visual Basic in Visual Studio 2012


This post discusses the new language features that is introduced in Visual Studio 2012. One of the main things that language team introduced is the idea of producing windows 8 App. These APPs are talking to new API called windows runtime. Small new feature Caller Info Attributes is also added in this release. More about […]

Caller Info Attributes in C# 5.0

Caller Info Attributes is a new feature in C# 5.0, Caller Info Attributes instructs the compiler to obtain and feed information into the parameter’s default value. You can tag optional parameters using Caller Info Attributes.

Three Caller Info Attributes are

[CallerMemberName]  – It applies the caller’s member name
[CallerFilePath] –  It applies the path to the caller’s source […]

Comparing Two Generic Lists in C#

Today I come across the problem while comparing two different lists. The basic requirement is finding the records which are present in one list but not in other and vise versa. I thought of sharing this piece of code which might  help for you to do the same task.
Let us take the two Generic lists […]

Documenting C# code with XML Comments

This article explains an easy and effective way of documenting your C# code. XML comments are the solution for generating a clean documentation for your code. Visual Studio environment allows you to generate a documentation file for your project. It helps your teammates and other people who using your code.
This post will explain how to […]

C# IDE Tips & Tricks Part 2

This post explains the some more tips on using Visual C# IDE to enhance developer productivity.

Solution Configurater  Right click your solution in your IDE then select the ConfigurationManager  you see the following window


where you have the option to select the project for building. We can select the required project in the solution and […]