Category: Miscellaneous
-
Type casting with is and as operator in C#
I have been seeing many developers are casting between two types using is operator. As we know, we do have as operator also for type casting. For purpose of this article, we are going to use below two classes, Very first let us try to understand, how is operator works? So , if we are […]
-
Editing applicationhost.config on 64 bit Windows 7 system
I had a very simple task to edit applicationhost.config file and it took my 2 hrs to get the solution. I navigated to folder C:\Windows\System32\inetsrv\config and I found applicationHost.config file. And when I clicked on file to open in Visual Studio, I got the below error Then I tried 1. Open visual studio in administrator […]
-
System.Object : a look on mother of all managed classes
In this article we will walkthrough and understand each function of Object class. System.Object is known as mother class of all the managed classes. All the classes are inherited from System.Object. It is base type for all the managed classes. So it defines the base behavior of all the managed classes. System.Object class contains below […]
-
Presented at Pune Dev. Con on 19th December 2010
Download PPT of session from here I would start with saying a great two day event at Pune. I was attending first time any event in Pune and I were overwhelmed. I really want to thanks Mahesh to pulling such a great event. Pune user group core members really deserve applause for their hard work […]
-
Upcoming book titled “Pro WCF 4.0” by Nishith Pathak
Title : Pro WCF 4.0 “Practical Microsoft SOA implementation” Author : Nishith Pathak Publisher : APress USA Expected Release : Jan/Feb 2011 Link : http://apress.com/book/view/9781430233688 About book The release of .NET 4.0 brought a wide range of new functionality to WCF. Developers and Architects with experience using WCF 3.5 or earlier who want to be […]
-
Using Lambda expression in FindAll()
I got a critical comment from @amazedsaint. You can read his blog http://amazedsaint.blogspot.com/ If you read my previous post http://dhananjaykumar.net/2010/10/01/findall-finding-multiple-items-in-c-list/ , I am using a method GreaterThanHun As predicate to pass as parameter to FindAll() Instead of that we can use 1. Anonymous method 2. Lambda expression So, I am going to show you here […]
-
FindAll() : Finding multiple items in C# List
Let us say we have a list of integer and we want to find all the number greater than 100. If list is as follow List<int> lst = new List<int>(); lst.Add(20); lst.Add(300); lst.Add(400); lst.Add(9); lst.Add(19); lst.Add(789); […]
-
Inserting element in sorted Generic list (List) using binary search in C#
I got a mail asking, “How we could insert an item in sorted generic list such that after insertion list would be remaining sorted?” Answer of this is using Binary Search As we know Binary search works on Divide and conquer algorithm. And running time using Binary search is very efficient. So we need to […]
-
Sorting a Generic List in C#
Objective This article will give code snippet on how to sort a generic list in C# I have a class called Product Product.cs class Product { public string ProductName { get; set; } public int ProductPrice { get; set; } } And List of Product as below, List<Product> prdList […]