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’.
Category Archives: Code-Snippets
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
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
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
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
There are certain ways to encode or decode string in angulars. In this code snippet we will take a look a very simplest way: Lets see how we can do the same in JQuery Encoding Decoding Try this when using IE10+ Here is the way using AngularJS
The following is the snapshot shhowing the output: