i have two completely difference project site like :
adminPanel(asp mvc site),utilities(classLibrary),mobileConnection(asp web api)
adminPanel Project and MobileConnection Project has separably authentication but their account has some share field,
Utilities Code (share with two project) :
public class MobileApplicationUser : IdentityUser
{
public virtual Profile Profile { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<MobileApplicationUser> manager, string authenticationType)
{
var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
return userIdentity;
}
}
public class AdminApplicationUser : IdentityUser
{
public virtual Organization organization { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<AdminApplicationUser> manager, string authenticationType)
{
var userIdentity = await manager.CreateIdentityAsync(this, authenticationType);
return userIdentity;
}
}
admin Project Code :
public class ApplicationDbContext : IdentityDbContext<AdminApplicationUser>
{
public ApplicationDbContext() : base("DefaultConnection", throwIfV1Schema: false)
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<AdminApplicationUser>().ToTable("AdminUser");
modelBuilder.Entity<IdentityRole>().ToTable("AdminRole");
modelBuilder.Entity<IdentityUserRole>().ToTable("AdminUserRole");
modelBuilder.Entity<IdentityUserClaim>().ToTable("AdminUserClaim");
modelBuilder.Entity<IdentityUserLogin>().ToTable("AdminUserLogin");
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
public DbSet<Profile> Profiles { get; set; }
public DbSet<Competition> Competitions { get; set; }
public DbSet<Message> Messages { get; set; }
public DbSet<Organization> Organizations { get; set; }
}
mobileConnection Project Code :
public class ApplicationDbContext : IdentityDbContext<MobileApplicationUser>
{
public ApplicationDbContext() : base("DefaultConnection", throwIfV1Schema: false)
{
}
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<AdminApplicationUser>().ToTable("MobileUser");
modelBuilder.Entity<IdentityRole>().ToTable("MobileRole");
modelBuilder.Entity<IdentityUserRole>().ToTable("MobileUserRole");
modelBuilder.Entity<IdentityUserClaim>().ToTable("MobileUserClaim");
modelBuilder.Entity<IdentityUserLogin>().ToTable("MobileUserLogin");
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
public DbSet<Profile> Profiles { get; set; }
public DbSet<Competition> Competitions { get; set; }
public DbSet<Message> Messages { get; set; }
public DbSet<Organization> Organizations { get; set; }
}
my profile and organization has relation together, so... i can`t update database both project and have my goal! what can i do ?