I've been tasked with creating a sub application of an existing site. The sub application needs to make use of the users in the parent site but this is under a different database.
I'm using Entity Framework code first for the new site. However, I wish to create a mapping between the parent database user table and the new code first database.
Is this possible?
- ParantDB.dbo.User
- SubDB.dbo.Order
SubDB.dbo.OrderItems
public class Order { public int OrderId { get; set; } public User Customer { get; set; } // Maintains a relationship user table } public class User { public int UserId { get; set; } .... }public class SubSiteContext : DbContext {
public DbSet<Order> Orders { get; set; } public DbSet<User> Users { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { //???? I Presume I need to do the mapping here?? } }