Hi,
I have a class:-
Person personobj = new Person();
personobj .FirstName = "Akiii";
personobj .LastName = "lethal";
personobj .Age = 90;
We can initialize the above as:-
Person personobj = new Person { FirstName="Akiii", LastName="lethal", Age=90 }; But can anybody tell me how to initialize the below code using object initializers :- Person personobj = new Person {
FirstName = "Scott",
LastName = "Guthrie"
Age = 32,
Address = new Address {
Street = "One Microsoft Way",
City = "Redmond",
State = "WA",
Zip = 98052
}
}; Looking forward for a reply....
Thanks and Regards
Akiii