/// <summary> /// 角色管理 /// </summary> /// <param name="userManager"></param> /// <param name="roleManager"></param> /// <param name="logger"></param> public RoleManagerController(AspNetUserManager userManager, AspNetRoleManager roleManager, ILoggerFactory logger) { this.userManager = userManager; this.roleManager = roleManager; this.logger = logger; mapper = roleManager.Mapper; }
public async Task Consume(UserUpdatedProfileAction message) { try { // Notworking Console.WriteLine("User Profile Settigs Action Handled For User {0} and Name {1}", message.AppUserId, message.Name); AspNetUserManager <AppUser> manager = new AspNetUserManager <AppUser>(null, null, null, null, null, null, null, null, null); var user = await manager.FindByIdAsync(message.AppUserId); user.Name = message.Name; user.Surname = message.Surname; user.Status = message.Status; var upd = await manager.UpdateAsync(user); manager.Dispose(); Console.WriteLine("User Profile Settigs Action Handled For User {0} and Name {1}", message.AppUserId, message.Name); } catch (Exception ex) { Console.WriteLine("User Profile Settigs Action CANNOT Handled For User {0} and Name {1}", message.AppUserId, message.Name); Console.WriteLine(ex.Message); if (ex.InnerException != null) { Console.WriteLine(ex.InnerException.Message); } } }
public AspNetUser GetByUserName(string username) { using (AspNetUserManager manager = new AspNetUserManager()) { return(manager.GetByUserName(username)); } }
private async Task <AspNetUser> FindUserAsync(string userName, string password) { using (AspNetUserManager manager = new AspNetUserManager()) { return(await manager.FindUser(userName, password)); } }
public AccountBLL(AspNetUserManager <User> userManager, SignInManager <User> signInManager, IUnitOfWork uow) { _uow = uow; _signInManager = signInManager; _userManager = userManager; }
public async Task <IdentityResult> GenerateUserIdentityAsync(AspNetUserManager <ApplicationUser> manager) { // Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType var userIdentity = await manager.CreateAsync(this); // Add custom user claims here return(userIdentity); }
protected override void Dispose(bool disposing) { if (disposing && _userManager != null) { _userManager.Dispose(); _userManager = null; } base.Dispose(disposing); }
/// <summary> /// /// </summary> /// <param name="logger"></param> /// <param name="userManager"></param> /// <param name="signInManager"></param> /// <param name="emailSender"></param> /// <param name="smsSender"></param> public ManagerController(ILoggerFactory logger, AspNetUserManager userManager, SignInManager signInManager, IEmailSender emailSender, ISmsSender smsSender) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _smsSender = smsSender; }
public HomeController( AspNetUserManager <WebUser> userManager, //UserManager<WebUser> userManager, SignInManager <WebUser> signInManager, RoleManager <IdentityRole> roleManager) { _userManager = userManager; _roleManager = roleManager; _signInManager = signInManager; }
/// <summary> /// 账户管理 /// </summary> /// <param name="signInManager"></param> /// <param name="aspNetUserManager"></param> /// <param name="emailSender"></param> /// <param name="smsSender"></param> /// <param name="tokenGenerater"></param> /// <param name="tokenManager"></param> public AccountController(SignInManager signInManager, AspNetUserManager aspNetUserManager, IEmailSender emailSender, ISmsSender smsSender, TokenGenerater tokenGenerater, TokenManager tokenManager) { _signInManager = signInManager; _userManager = aspNetUserManager; _emailSender = emailSender; _smsSender = smsSender; this.tokenGenerater = tokenGenerater; this.tokenManager = tokenManager; }
/// <summary> /// Initializes a new instance of the <see cref="IdentityService"></see> class. /// </summary> public IdentityService( AspNetUserManager <ApplicationUser> userManager, IHttpClientFactory clientFactory, IMedicalRegistrationRepository medicalRegistrationRepository, IOptions <ClientIdentityOptions> clientIdentityOptions, ILogger <IdentityService> logger) { this.userManager = userManager; this.medicalRegistrationRepository = medicalRegistrationRepository; this.logger = logger; httpClient = clientFactory.CreateClient(); clientIdentity = clientIdentityOptions.Value; }
public AccountController( AspNetUserManager <User> userManager, SignInManager <User> signInManager, RoleManager <Role> roleManager, IOptions <AppSettings> appSettings, ILogger <AccountController> logger ) : base(appSettings, logger) { _signInManager = signInManager; _userManager = userManager; _roleManager = roleManager; IdentityDataInitializer.SeedData(_userManager, _roleManager); }
public SharedTravelsController( ISharedTravelsService sharedTravelsService, IUsersService usersService, ICastCollectionsService castCollectionsService, IRatingService ratingService, ICarsService carsService, IImagesService imagesService, AspNetUserManager <ElectricTravelUser> userManager) { this.sharedTravelsService = sharedTravelsService; this.ratingService = ratingService; this.carsService = carsService; this.imagesService = imagesService; this.userManager = userManager; this.usersService = usersService; this.castCollectionsService = castCollectionsService; }
protected override void Dispose(bool disposing) { if (disposing) { if (_userManager != null) { _userManager.Dispose(); _userManager = null; } if (_signInManager != null) { _signInManager.Dispose(); _signInManager = null; } } base.Dispose(disposing); }
public AccountController(AspNetUserManager userManager, ApplicationSignInManager signInManager) { UserManager = userManager; SignInManager = signInManager; }
public AccountController(SignInManager <IdentityUser> signInManager, AspNetUserManager <IdentityUser> userManager, ILogger <AccountController> logger) { _signInManager = signInManager; _userManager = userManager; _logger = logger; }
public UsersController(IUserService service, AspNetUserManager <ChushkaUser> manager, SignInManager <ChushkaUser> signInManager) { this.service = service; this.manager = manager; this.signInManager = signInManager; }
public AcountController(SignInManager <IdentityUser> signInManager, UserManager <IdentityUser> userManager) { _signInManager = signInManager; _userManager = (AspNetUserManager <IdentityUser>)userManager; }
// This function will get triggered/executed when a new message is written // on an Azure Queue called queue. public Functions() { telemetria = new Trace(); aspNetUserManager = new AspNetUserManager(); }
public AspNetUserServices() { _aspNetUserManager = new AspNetUserManager(); }
public UsersController(AspNetUserManager <AppUser> userManager) { _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager)); }
public UsersController(UserFactory userFactory, PartnerFactory partnerFactory, AspNetUserManager <DiscountsUser> userManager) { _userFactory = userFactory; _partnerFactory = partnerFactory; _userManager = userManager; }
public RolesProfileService(IUserClaimsPrincipalFactory <ApplicationUser> claimsFactory, AspNetUserManager <ApplicationUser> userManager) { this.claimsFactory = claimsFactory; this.userManager = userManager; }