Getting description of Enum in C#?

In this code snippet we will look an easy way to get description of Enum. Lets discuss a simplest way, just need to define an extension method: Our pre-defined Enum: Define an extension method: Do not forget to add following namespace, in above: Now, call this extension method as: Above will give you: ‘Advance’.

August 12, 2015 | by

Sql Like functionality in LINQ?

In this code snippet we will create an extension method which will add functionality similar to functionality of SQL ‘Like’ ‘Can we use a ‘Like’ functionality in LINQ, which contains same functioning as ‘Like’ in SQL’? Are you going to say ‘No’, wait just read this snippet and you will say ‘Yes’ 🙂 First, lets…

August 12, 2015 | by

IsNullOrEmpty for Generic collections in C#

In this code snippet we will see creation and implementation of IsNullOrEmpty for collections. Can I implement IsNullOrEmpty for my Generic collections/lists ? Its out of C#. Unfortunately there is only one method which is of a String method String.IsNullOrEmpty() available, framework does not provide us such things. What is the solution for this. A…

August 12, 2015 | by

Calling an API using RestSharp in ASP.NET

In these days Rest Services are most popular, everyone like to use Rest Services. RestSharp is a Simple REST and HTTP client for .Net There are many ways to consume RESTFull services in client veg. WebClient etc. But, RestSharp is the wonderful to consule REST services. This provides a simple call while we want o…

August 12, 2015 | by

Auto Properties in C# 6.0

There are lot of new and exciting features added introduced in C#6.0 lets discuss new feature ‘auto properties‘ In earlier version, our declaration was: In above we need to do something like this classname.property name to get / set the values. Now you can imagine in C#6.0 we can directly set values like: And here…

November 30, 2014 | by