Пример #1
0
        public void CreateNewUser(User user)
        {
            if (string.IsNullOrWhiteSpace(user.Username))
            {
                throw new ArgumentException("You passed in an invalid parameter", "Username");
            }

            if (string.IsNullOrWhiteSpace(user.Password))
            {
                throw new ArgumentException("You passed in an invalid parameter", "Password");
            }


            if (string.IsNullOrWhiteSpace(user.FirstName))
            {
                throw new ArgumentException("You passed in an invalid parameter", "FirstName");
            }

            if (string.IsNullOrWhiteSpace(user.LastName))
            {
                throw new ArgumentException("You passed in an invalid parameter", "LastName");
            }

            //userList.Add(user);
            userRepo.AddToList(user);
        }