Beispiel #1
0
        public static ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> ToTable <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> builder, string name, string schema)
            where TEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <OwnedNavigationBuilder <TEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.ToTable(name, schema);
                break;

            case IInfrastructure <OwnedNavigationBuilder> nongenericBuilder:
                nongenericBuilder.Instance.ToTable(name, schema);
                break;
            }

            return(builder);
        }
Beispiel #2
0
        public static ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TDependentEntity> IsMemoryOptimized <TEntity,
                                                                                                                 TDependentEntity>(
            this ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TDependentEntity> builder, bool memoryOptimized = true)
            where TEntity : class
            where TDependentEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <OwnedNavigationBuilder <TEntity, TDependentEntity> > genericBuilder:
                genericBuilder.Instance.IsMemoryOptimized(memoryOptimized);
                break;

            case IInfrastructure <OwnedNavigationBuilder> nongenericBuilder:
                nongenericBuilder.Instance.IsMemoryOptimized(memoryOptimized);
                break;
            }

            return(builder);
        }
        public static ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> HasCheckConstraint <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> builder,
            string name,
            string?sql)
            where TEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <OwnedNavigationBuilder <TEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.HasCheckConstraint(name, sql);
                break;

            case IInfrastructure <OwnedNavigationBuilder> nongenericBuilder:
                nongenericBuilder.Instance.HasCheckConstraint(name, sql);
                break;
            }

            return(builder);
        }
        public static ModelBuilderTest.TestOwnedNavigationBuilder <TOwnerEntity, TRelatedEntity> ToTable <TOwnerEntity, TRelatedEntity>(
            this ModelBuilderTest.TestOwnedNavigationBuilder <TOwnerEntity, TRelatedEntity> builder,
            string?name,
            Action <RelationalModelBuilderTest.TestTableBuilder <TRelatedEntity> > buildAction)
            where TOwnerEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <OwnedNavigationBuilder <TOwnerEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.ToTable(name,
                                                b => buildAction(new RelationalModelBuilderTest.GenericTestTableBuilder <TRelatedEntity>(b)));
                break;

            case IInfrastructure <OwnedNavigationBuilder> nongenericBuilder:
                nongenericBuilder.Instance.ToTable(name,
                                                   b => buildAction(new RelationalModelBuilderTest.NonGenericTestTableBuilder <TRelatedEntity>(b)));
                break;
            }

            return(builder);
        }
        public static ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> HasCheckConstraint <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestOwnedNavigationBuilder <TEntity, TRelatedEntity> builder,
            string name,
            string sql,
            Action <RelationalModelBuilderTest.TestCheckConstraintBuilder> buildAction)
            where TEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <OwnedNavigationBuilder <TEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.HasCheckConstraint(name, sql,
                                                           b => buildAction(new RelationalModelBuilderTest.NonGenericTestCheckConstraintBuilder(b)));
                break;

            case IInfrastructure <OwnedNavigationBuilder> nongenericBuilder:
                nongenericBuilder.Instance.HasCheckConstraint(name, sql,
                                                              b => buildAction(new RelationalModelBuilderTest.NonGenericTestCheckConstraintBuilder(b)));
                break;
            }

            return(builder);
        }