I have the following class:
public class Example
{
public static string GetName(string username)
{
//Code to retrieve record from database
return RetrievedString;
}
}
I use this to get a user's name to some functions that need it (e.g putting user's name in session on login etc.).
The code works. My confusion is if it's correct to have this be a static string or whether I should just make it non static and initialize an object and use the GetName as a property to retrieve the string.
Keep in mind that multiple users will be online concurrently.