One interesting feature of delegates in C# is that it provide ways to attach / detach more than one methods that has method signature similar to the delegate declared and combine them together. This combining or attaching / detaching of methods to a delegate is called Multicasting. Behind the scenes: This multicasting is possible because delegates inherit from System.MulticastDelegate which in turn inherits from System.Delegate, which inherits from Object class. How to multicast: Multicasting can be done using += and / or -= operator. Here is an example that demonstrate use of += and -= to multicast delegates. private delegate void Greetings(); static void Main(string[] args) { SayHello(); Console.ReadLine(); } public static void SayHelloToScott() { Console.WriteLine("Hi Mr. Delegate, from Scott"); } public static void SayHelloToAlex() { Console.WriteLine("How about a coffee? from Alex"); } public static void SayHelloToJasmine() { Console.WriteLine("Hi delegates, from Jasmine"); } public static void SayHelloToJsinh( » Read more

 Jsinh        

I had a weird experience before few days, I definitely knew how to solve the problem and I am sure it is the right way to do it. Thinking it would not be any different to map a datatable to POCO class(es) using Automapper. But it didn't turned out to be completely true. I have been playing with Automapper for couple of years now in my day-to-day work, but I stumbled a bit this time. Situationally, I was not able to conclude the problem with a working solution at that moment, thus I would take this opportunity and write about it so anyone out there who is facing same or similar problem can find their answers. Problem Data filled into a datatable was expected to be converted to Json object. If the datatable contains more than one row the resultant Json should have list of Json objects for each » Read more

 Jsinh