I’m trying to make something similar to ASP.NET’s User.Identity.Name. I’ve already made the class to hold the information but I don’t know how to write to the variable since I only added the get{};
private static string _firstName;
public static string FirstName
{
get { return _firstName; }
}
There are 2 ways to do this. The first way is adding a private setter.
The other option is add a parameter to your constructor and set the value inside it.