protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); TaskEntityConfiguration.Configure(modelBuilder.Entity <Task>()); modelBuilder.Entity <EmployeeTask>() .HasKey(c => new { c.EmployeeId, c.Task2Id }); modelBuilder.Entity <BinaryObject>(b => { b.HasIndex(e => new { e.TenantId }); }); modelBuilder.Entity <ChatMessage>(b => { b.HasIndex(e => new { e.TenantId, e.UserId, e.ReadState }); b.HasIndex(e => new { e.TenantId, e.TargetUserId, e.ReadState }); b.HasIndex(e => new { e.TargetTenantId, e.TargetUserId, e.ReadState }); b.HasIndex(e => new { e.TargetTenantId, e.UserId, e.ReadState }); }); modelBuilder.Entity <Friendship>(b => { b.HasIndex(e => new { e.TenantId, e.UserId }); b.HasIndex(e => new { e.TenantId, e.FriendUserId }); b.HasIndex(e => new { e.FriendTenantId, e.UserId }); b.HasIndex(e => new { e.FriendTenantId, e.FriendUserId }); }); modelBuilder.Entity <Tenant>(b => { b.HasIndex(e => new { e.SubscriptionEndDateUtc }); b.HasIndex(e => new { e.CreationTime }); }); modelBuilder.Entity <SubscriptionPayment>(b => { b.HasIndex(e => new { e.Status, e.CreationTime }); b.HasIndex(e => new { e.PaymentId, e.Gateway }); }); modelBuilder.ConfigurePersistedGrantEntity(); }
protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); TaskEntityConfiguration.Configure(modelBuilder.Entity <Task>()); EmployeeEntityConfiguration.Configure(modelBuilder.Entity <Employee>()); }