S
shapper
Hello,
I am trying to create an object where one of the properties is a list
of string. So I am creating an array of strings and converting it to a
list. Something like:
Account a = new Account { Approved = true, Roles = (new String[]
{ "Admin", "Col" }).ToList());
I am talking about the Roles which is a List<String>
I get the error:
Syntax error, ',' expected
What am I missing?
Can't I create this object in one code line?
Thanks,
Miguel
I am trying to create an object where one of the properties is a list
of string. So I am creating an array of strings and converting it to a
list. Something like:
Account a = new Account { Approved = true, Roles = (new String[]
{ "Admin", "Col" }).ToList());
I am talking about the Roles which is a List<String>
I get the error:
Syntax error, ',' expected
What am I missing?
Can't I create this object in one code line?
Thanks,
Miguel