umair mohsin

umair mohsin

  • 1.3k
  • 359
  • 56.9k

tables not linking with identity tables

Feb 5 2024 7:59 PM

i have linked my tables to aspnet identity tables using below code

    public class ApplicationUser : IdentityUser
    {

        public string FirstName { get; set; }
        public string LastName { get; set; }
      
        public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
        {
            var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);

            return userIdentity;
        }

        public virtual Employer Employer { get; set; }
        public virtual Candidate Candidate { get; set; }
   }

when i a trying to register an employer or evena candidate using identity i got the error there is already an object named Candidate

in configuration.cs automaticmigartions set to true

and database initilizer is set to migratetolatestversion

employer and candidates are models in the different project and aspnet identity is a different project.

 

how can i link my tables appropriately with identity tables to avodi these issues.

 


Answers (1)