Exemple #1
0
        public static User GetUserByUsername(string usernameInput)
        {
            string username = usernameInput.ToLower();
            User   dbItem   = StorageImpl.QueryUser(username);

            if (dbItem != null)
            {
                return(dbItem);
            }

            return(null);
        }
Exemple #2
0
        public static User CreateUser(string usernameInput)
        {
            string username = usernameInput.ToLower();

            if (StorageImpl.QueryUser(username) != null)
            {
                return(null); // todo error
            }

            User u = new User
            {
                UserName = username,
                ID       = getID()
            };

            StorageImpl.CreateUser(u);

            return(u);
        }