本文整理汇总了C#中UserAccountService类的典型用法代码示例。如果您正苦于以下问题:C# UserAccountService类的具体用法?C# UserAccountService怎么用?C# UserAccountService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserAccountService类属于命名空间,在下文中一共展示了UserAccountService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OwinAuthenticationService
public OwinAuthenticationService(
UserAccountService svc,
IDictionary<string, object> env
)
: this(MembershipRebootOwinConstants.AuthenticationType, svc, env, null)
{
}
示例2: CallsDisposeOnUserRepo
public void CallsDisposeOnUserRepo()
{
var userAccountRepo = new Mock<IUserAccountRepository>();
var sub = new UserAccountService(userAccountRepo.Object, null, null);
sub.Dispose();
userAccountRepo.Verify(x => x.Dispose());
}
示例3: LoginController
public LoginController(
UserAccountService userService,
AuthenticationService authSvc)
{
this.userAccountService = userService;
this.authSvc = authSvc;
}
示例4: CallsSaveChangesOnRepository
public void CallsSaveChangesOnRepository()
{
var repo = new Mock<IUserAccountRepository>();
var sub = new UserAccountService(repo.Object, null, null);
sub.SaveChanges();
repo.Verify(x => x.SaveChanges());
}
示例5: OwinAuthenticationService
public OwinAuthenticationService(
UserAccountService svc,
IDictionary<string, object> environment
)
: this(svc, environment, null)
{
}
示例6: Init
public void Init()
{
securitySettings = new SecuritySettings();
securitySettings.PasswordHashingIterationCount = 1; // tests will run faster
configuration = new MembershipRebootConfiguration(securitySettings);
repository = new FakeUserAccountRepository();
subject = new UserAccountService(configuration, repository);
}
示例7: CallsUpdateOnRepository
public void CallsUpdateOnRepository()
{
var repo = new Mock<IUserAccountRepository>();
var sub = new UserAccountService(repo.Object, null, null);
var ua = new UserAccount();
sub.Update(ua);
repo.Verify(x => x.Update(ua));
}
示例8: Validate
public ValidationResult Validate(UserAccountService service, UserAccount account, string value)
{
if (value.Length < 4)
{
return new ValidationResult("Password must be at least 4 characters long");
}
return null;
}
示例9: InitDatabase
private void InitDatabase()
{
var svc = new UserAccountService(new DefaultUserAccountRepository(SecuritySettings.Instance.ConnectionStringName), null, null);
if (svc.GetByUsername("admin") == null)
{
var account = svc.CreateAccount("admin", "admin123", "[email protected]");
svc.VerifyAccount(account.VerificationKey);
account.AddClaim(ClaimTypes.Role, "Administrator");
svc.Update(account);
}
}
示例10: btRegister_Click
protected void btRegister_Click(object sender, EventArgs e)
{
UserAccountService uas = new UserAccountService();
if (uas.UserExists(txtUserName.Text) || txtPassword.Text != txtConfirm.Text)
lblResult.Text = "UserName already exists or Password Mistach";
else
{
uas.CreateAccount(txtUserName.Text, txtPassword.Text);
Response.Redirect("Login.aspx");
}
}
示例11: InitDatabase
private void InitDatabase()
{
var svc = new UserAccountService(new EFUserAccountRepository(), null, null);
if (svc.GetByUsername("admin") == null)
{
var account = svc.CreateAccount("admin", "admin123", "[email protected]");
svc.VerifyAccount(account.VerificationKey);
account.AddClaim(ClaimTypes.Role, "Administrator");
svc.Update(account);
}
}
示例12: Init
public void Init()
{
oldIterations = SecuritySettings.Instance.PasswordHashingIterationCount;
SecuritySettings.Instance.PasswordHashingIterationCount = 1; // tests will run faster
configuration = new MembershipRebootConfiguration();
key = new KeyNotification();
configuration.AddEventHandler(key);
repository = new FakeUserAccountRepository();
userAccountService = new UserAccountService(configuration, repository);
subject = new TestAuthenticationService(userAccountService);
}
示例13: PasswordResetController
public PasswordResetController(UserAccountService userAccountService)
{
this.userAccountService = userAccountService;
}
示例14: CloseAccountController
public CloseAccountController(UserAccountService userAccountService)
{
this.userAccountService = userAccountService;
}
示例15: LinkedAccountController
public LinkedAccountController(
AuthenticationService AuthenticationService)
{
this.authenticationService = AuthenticationService;
this.userAccountService = AuthenticationService.UserAccountService;
}