示例#1
0
 /// <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;
 }
示例#2
0
        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));
     }
 }
示例#5
0
 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);
        }
示例#7
0
        protected override void Dispose(bool disposing)
        {
            if (disposing && _userManager != null)
            {
                _userManager.Dispose();
                _userManager = null;
            }

            base.Dispose(disposing);
        }
示例#8
0
 /// <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;
 }
示例#9
0
 public HomeController(
     AspNetUserManager <WebUser> userManager,
     //UserManager<WebUser> userManager,
     SignInManager <WebUser> signInManager,
     RoleManager <IdentityRole> roleManager)
 {
     _userManager   = userManager;
     _roleManager   = roleManager;
     _signInManager = signInManager;
 }
示例#10
0
 /// <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;
 }
示例#11
0
 /// <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;
 }
示例#12
0
 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);
 }
示例#13
0
 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;
 }
示例#14
0
        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);
        }
示例#15
0
 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;
 }
示例#17
0
 public UsersController(IUserService service, AspNetUserManager <ChushkaUser> manager, SignInManager <ChushkaUser> signInManager)
 {
     this.service       = service;
     this.manager       = manager;
     this.signInManager = signInManager;
 }
示例#18
0
 public AcountController(SignInManager <IdentityUser> signInManager,
                         UserManager <IdentityUser> userManager)
 {
     _signInManager = signInManager;
     _userManager   = (AspNetUserManager <IdentityUser>)userManager;
 }
示例#19
0
 // 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();
 }
示例#20
0
 public AspNetUserServices()
 {
     _aspNetUserManager = new AspNetUserManager();
 }
 public UsersController(AspNetUserManager <AppUser> userManager)
 {
     _userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
 }
示例#22
0
 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;
 }