Compare commits
No commits in common. "0a4c4abcbcb3e8677ba7c2ad22b33caac9fcfef4" and "53df5dcdc13a531a5403fa5e0fadbb9d811f2f55" have entirely different histories.
0a4c4abcbc
...
53df5dcdc1
1 changed files with 0 additions and 55 deletions
|
@ -154,60 +154,5 @@ public class ApplicationDbContext : DbContext
|
|||
entity.HasMany(ptv => ptv.Users)
|
||||
.WithMany(u => u.ProductTableViews);
|
||||
});
|
||||
|
||||
// User
|
||||
modelBuilder.Entity<DbUser>(entity =>
|
||||
{
|
||||
entity.HasKey(u => u.Id);
|
||||
|
||||
entity.HasMany(u => u.CompanyTableViews)
|
||||
.WithMany(ctv => ctv.Users);
|
||||
|
||||
entity.HasMany(u => u.ProductTableViews)
|
||||
.WithMany(ptv => ptv.Users);
|
||||
|
||||
entity.HasMany(u => u.CompanyRatings)
|
||||
.WithOne(cr => cr.User)
|
||||
.HasForeignKey(cr => cr.UserId);
|
||||
|
||||
entity.HasMany(u => u.ProductRatings)
|
||||
.WithOne(pr => pr.User)
|
||||
.HasForeignKey(pr => pr.UserId);
|
||||
|
||||
entity.HasMany(u => u.UserCompanyTableStats)
|
||||
.WithOne(ucts => ucts.User)
|
||||
.HasForeignKey(ucts => ucts.UserId);
|
||||
|
||||
entity.HasMany(u => u.UserProductTableStats)
|
||||
.WithOne(upts => upts.User)
|
||||
.HasForeignKey(upts => upts.UserId);
|
||||
|
||||
entity.HasIndex(u => u.UserName)
|
||||
.IsUnique();
|
||||
});
|
||||
|
||||
// User Company Table Stat
|
||||
modelBuilder.Entity<DbUserCompanyTableStat>(entity =>
|
||||
{
|
||||
entity.HasKey(ucts => new { ucts.UserId, ucts.CompanyTableId });
|
||||
|
||||
entity.HasOne(ucts => ucts.User)
|
||||
.WithMany(u => u.UserCompanyTableStats);
|
||||
|
||||
entity.HasOne(ucts => ucts.CompanyTable)
|
||||
.WithMany();
|
||||
});
|
||||
|
||||
// User Product Table Stat
|
||||
modelBuilder.Entity<DbUserProductTableStat>(entity =>
|
||||
{
|
||||
entity.HasKey(upts => new { upts.UserId, upts.ProductTableId });
|
||||
|
||||
entity.HasOne(upts => upts.User)
|
||||
.WithMany(u => u.UserProductTableStats);
|
||||
|
||||
entity.HasOne(upts => upts.ProductTable)
|
||||
.WithMany();
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue