I would like to know if there is a method to write the below code in VB. ( Right now the equivalent VB.NET code looks too verbose )
List<DemoUsers> users = new List<DemoUsers>();
users.Add(new DemoUsers
{
UserName = "name1",
UserAddress = "Address1"
});
Right now I am writing it in VB.NET like
Dim users As New List(Of DemoUsers)
Dim usr1 As New DemoUsers()
usr1.UserName = "name1"
usr1.UserAddress = "Address1"
users.Add(usr1)
Does VB.NET have an equivalent C# short-hand? Also whats this short-hand method in C# called.
P.S: Could not google this short-hand notation availability as I dont know whats it called. Is there a name to call it?