Having a dumb day.
I have the following code:
UserRoles = Roles.GetRolesForUser(username);
If username is an empty string ("", user not logged in), then when I check the value of UserRoles
in the immediate window it shows:
{string[0]}
What is {string[0]}
?
How can I replicate this value to test my code for the case of an unlogged in user (username == "")?
NOTE: I have googled for this but to no avail.
GetRolesForUser returns an array of roles, so the "String[0]" in the immediate window just means that it knows the return type is an array (in this case strings), but there are zero entries (since no roles are returned for a blank user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With