Esempio n. 1
0
        public async Task Execute(Input input)
        {
            var user = new ApplicationUser
            {
                UserName    = input.UserName,
                Email       = input.Email,
                PhoneNumber = input.PhoneNumber,
                SSN         = input.SSN
            };

            var Email = await AuthenticationRepository.FindByEmail(input.Email);

            var Username = await AuthenticationRepository.FindByName(input.UserName);

            var Phone = await AuthenticationRepository.FindByPhoneNumber(input.PhoneNumber);

            var SSN = await AuthenticationRepository.FindBySSN(input.SSN);

            if (Email != null)
            {
                OutputHandler.Error("Email Already Exist");
            }
            if (Username != null)
            {
                OutputHandler.Error("Username Already Exist");
            }
            if (Phone != null)
            {
                OutputHandler.Error("Phone number Already Exist");
            }
            if (SSN != null)
            {
                OutputHandler.Error("SSN Name Already Exist");
            }
            else
            {
                var result4 = await AuthenticationRepository.Createuser(user, input.password);

                OutputHandler.Handle(new Output("Registraction Successful.."));
            }
        }