Ejemplo n.º 1
0
        public IActionResult Index(GeneratePasswordViewModel model)
        {
            if (!model.IsConfigured)
            {
                model.SetDefault();
            }

            return(View(model));
        }
Ejemplo n.º 2
0
        private static GeneratePasswordViewModel GeneratePassword(GeneratePasswordViewModel model)
        {
            if (!model.IsConfigured)
            {
                model.SetDefault();
            }

            var generator = new Generator();

            model.GeneratedPassword = generator.GeneratePassword(
                model.PasswordLength,
                model.HasLowercase,
                model.HasUppercase,
                model.HasDigit,
                model.HasNonAlphanumeric);

            return(model);
        }