public IActionResult Index(GeneratePasswordViewModel model) { if (!model.IsConfigured) { model.SetDefault(); } return(View(model)); }
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); }