Ejemplo n.º 1
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            TaskEntityConfiguration.Configure(modelBuilder.Entity <Task>());
            EmployeeEntityConfiguration.Configure(modelBuilder.Entity <Employee>());

            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>());
 }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            AlbumEntityConfiguration
            .Configure(modelBuilder.Entity <AlbumEntity>());

            AlbumPriceEntityConfiguration
            .Configure(modelBuilder.Entity <AlbumPriceEntity>());

            AlbumRatingEntityConfiguration
            .Configure(modelBuilder.Entity <AlbumRatingEntity>());

            ArtistEntityConfiguration
            .Configure(modelBuilder.Entity <ArtistEntity>());

            CompanyEntityConfiguration
            .Configure(modelBuilder.Entity <CompanyEntity>());

            ContactsEntityConfiguration
            .Configure(modelBuilder.Entity <ContactsEntity>());

            DepartmentEmployeeEntityConfiguration
            .Configure(modelBuilder.Entity <DepartmentEmployeeEntity>());

            DepartmentEntityConfiguration
            .Configure(modelBuilder.Entity <DepartmentEntity>());

            EmployeeEntityConfiguration
            .Configure(modelBuilder.Entity <EmployeeEntity>());

            GenderEntityConfiguration
            .Configure(modelBuilder.Entity <GenderEntity>());

            LanguageEntityConfiguration
            .Configure(modelBuilder.Entity <LanguageEntity>());

            MusicTypeEntityConfiguration
            .Configure(modelBuilder.Entity <MusicTypeEntity>());

            RatingTypeEntityConfiguration
            .Configure(modelBuilder.Entity <RatingTypeEntity>());

            RoleEntityConfiguration
            .Configure(modelBuilder.Entity <RoleEntity>());

            SiteStyleTypeEntityConfiguration
            .Configure(modelBuilder.Entity <SiteStyleTypeEntity>());

            SongEntityConfiguration
            .Configure(modelBuilder.Entity <SongEntity>());

            SongPriceEntityConfiguration
            .Configure(modelBuilder.Entity <SongPriceEntity>());

            SystemTypeEntityConfiguration
            .Configure(modelBuilder.Entity <SystemTypeEntity>());

            UserEntityConfiguration
            .Configure(modelBuilder.Entity <UserEntity>());

            UserRoleEntityConfiguration
            .Configure(modelBuilder.Entity <UserRoleEntity>());

            VersionHistoryEntityConfiguration
            .Configure(modelBuilder.Entity <VersionHistoryEntity>());

            base.OnModelCreating(modelBuilder);
        }