Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public virtual int AccessFailedCount { get; set; }
- public virtual ICollection<TClaim> Claims { get; }
- public virtual string Email { get; set; }
- public virtual bool EmailConfirmed { get; set; }
- public virtual TKey Id { get; set; }
- public virtual bool LockoutEnabled { get; set; }
- public virtual DateTime? LockoutEndDateUtc { get; set; }
- public virtual ICollection<TLogin> Logins { get; }
- public virtual string PasswordHash { get; set; }
- public virtual string PhoneNumber { get; set; }
- public virtual bool PhoneNumberConfirmed { get; set; }
- public virtual ICollection<TRole> Roles { get; }
- public virtual string SecurityStamp { get; set; }
- public virtual bool TwoFactorEnabled { get; set; }
- public virtual string UserName { get; set; }
- public class ApplicationUser : IdentityUser
- {
- public bool Has_accepted_policy { get; set; }
- public int user_type_id { get; set; }
- }
- public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
- {
- public ApplicationDbContext()
- : base("DefaultConnection")
- {
- }
- }
- public string Id { get; set; }
- [Required]
- [StringLength(256)]
- public string UserName { get; set; }
- public string PasswordHash { get; set; }
- public string SecurityStamp { get; set; }
- [StringLength(256)]
- public string Email { get; set; }
- public bool EmailConfirmed { get; set; }
- public bool Is_Active { get; set; }
- [Required]
- [StringLength(128)]
- public string Discriminator { get; set; }
- public int? user_type_id { get; set; }
- public bool Has_accepted_policy { get; set; }
- public string PhoneNumber { get; set; }
- public bool PhoneNumberConfirmed { get; set; }
- public bool TwoFactorEnabled { get; set; }
- public DateTime? LockoutEndDateUtc { get; set; }
- public bool LockoutEnabled { get; set; }
- public int AccessFailedCount { get; set; }
- ... other virtual properties
- IdentityResult result = await UserManager.CreateAsync(user, model.Password);
- UserManagerFactory = () => new UserManager<ApplicationUser>(new UserStore<ApplicationUser>());
- public AccountController()
- : this(Startup.UserManagerFactory(), Startup.OAuthOptions.AccessTokenFormat)
- {
- }
- public AccountController(UserManager<ApplicationUser> userManager,
- ISecureDataFormat<AuthenticationTicket> accessTokenFormat)
- {
- UserManager = userManager;
- AccessTokenFormat = accessTokenFormat;
- }
- public UserManager<ApplicationUser> UserManager { get; private set; }
- UserManagerFactory = () => new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
- UserManagerFactory = () => new UserManager<ApplicationUser>(new UserStore<ApplicationUser>());
- UserManagerFactory = () => new UserManager<ApplicationUser>(new UserStore<ApplicationUser>(new ApplicationDbContext()));
- <add name="MyConnString" connectionString="Data Source=server; Initial Catalog=db_name; User ID=user_id; Password=password; Connect Timeout=60;" providerName="System.Data.SqlClient" />
- public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
- {
- public ApplicationDbContext()
- : base("MyConnString")
- {
- }
- }
- public class ApplicationUserManager : UserManager<ApplicationUser> // the name conflict
- {
- public ApplicationUserManager(IUserStore<ApplicationUser> store)
- : base(store)
- {
- }
- <add name="DefaultConnection" connectionString="Server=qadb.myserver.com;Database=mydb;User Id=myuser;Password=mypass;" providerName="System.Data.SqlClient" />
- public partial class GoldfishDbContext : IdentityDbContext<ApplicationUser>
- {
- ....
- }
- builder.RegisterType<ApplicationUserManager>().InstancePerRequest();
- public ApplicationUserManager UserManager
- {
- get
- {
- return _userManager ?? HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
- }
- private set
- {
- _userManager = value;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement