TShockAPI.DB.UserManager.GetUsersByName C# (CSharp) Метод

GetUsersByName() публичный Метод

Gets all users from the database with a username that starts with or contains username
public GetUsersByName ( string username, bool notAtStart = false ) : List
username string Rough username search. "n" will match "n", "na", "nam", "name", etc
notAtStart bool If is not the first part of the username. If true then "name" would match "name", "username", "wordsnamewords", etc
Результат List
        public List<User> GetUsersByName(string username, bool notAtStart = false)
        {
            try
            {
                List<User> users = new List<User>();
                string search = notAtStart ? string.Format("%{0}%", username) : string.Format("{0}%", username);
                using (var reader = _database.QueryReader("SELECT * FROM Users WHERE Username LIKE @0",
                    search))
                {
                    while (reader.Read())
                    {
                        users.Add(LoadUserFromResult(new User(), reader));
                    }
                }
                return users;
            }
            catch (Exception ex)
            {
                TShock.Log.Error(ex.ToString());
            }
            return null;
        }