What happens when a constuctor is called

Consider the following class public class MyClass{    public int myField = 4;     public MyClass()    {        this.myField = 5;    }}  when we compile this class, we get an assembly with IL in it. The parameterless constructor gets converted into a method with the name .ctor Now, if we see the IL that gets generated for this .ctor method, we might expect it to have IL opcodes to assign the value…

2

what using the ‘using’ block in c# does to your code

Let us take a simple console application which has the below code written in it     class Program     {         static void Main(string[] args)         {             using (SqlConnection connection = new SqlConnection())             {                 connection.Open();                 connection.Close();             }         }     } the IL that gets generated for the above program…

2

How To: Enable multiple netTcp port sharing for WCF end-points

Getting straight to the point, the checklist for this can be found here. 3 basic tasks need to be done: – 1.       Enable port sharing by either adding an attribute in your code like below   NetTcpBinding binding = new NetTcpBinding(“netTcpBinding”); binding.PortSharingEnabled = true; serviceHost = new ServiceHost(typeof(MsiFacade35Service)); serviceHost.AddServiceEndpoint(typeof(IMsiFacade35Service), binding, “net.tcp://MyServer/MyServiceEndpoint”);   Or by setting…

1