using Object Initializers with Sub object
I have Two Entities like as shown below:
Now i want to use Powerful feature of C# 3.0 object initializers. I am using it since few days but with simple types not with complex type like Employee.Address.. but its good to know that c#3.0 also supports this…Thanks to “Anders hejlsberg” for such a nice programming language…anyway lets look how we can do this..here’s the way..
and output is:
My intention of showing output is that the code works 🙂 just kidding… Enjoy the new and powerful features of C#3.0…