예제 #1
0
        public static ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> ToTable <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> builder, string name, string schema)
            where TEntity : class
            where TRelatedEntity : class
        {
            var genericBuilder = (builder as IInfrastructure <ReferenceOwnershipBuilder <TEntity, TRelatedEntity> >)?.Instance;

            if (genericBuilder != null)
            {
                genericBuilder.ToTable(name, schema);
            }
            else
            {
                (builder as IInfrastructure <ReferenceOwnershipBuilder>).Instance.ToTable(name, schema);
            }
            return(builder);
        }
        public static ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> ToTable <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> builder, string name, string schema)
            where TEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <ReferenceOwnershipBuilder <TEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.ToTable(name, schema);
                break;

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

            return(builder);
        }
        public static ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> ForSqlServerIsMemoryOptimized <TEntity, TRelatedEntity>(
            this ModelBuilderTest.TestReferenceOwnershipBuilder <TEntity, TRelatedEntity> builder, bool memoryOptimized = true)
            where TEntity : class
            where TRelatedEntity : class
        {
            switch (builder)
            {
            case IInfrastructure <ReferenceOwnershipBuilder <TEntity, TRelatedEntity> > genericBuilder:
                genericBuilder.Instance.ForSqlServerIsMemoryOptimized(memoryOptimized);
                break;

            case IInfrastructure <ReferenceOwnershipBuilder> nongenericBuilder:
                nongenericBuilder.Instance.ForSqlServerIsMemoryOptimized(memoryOptimized);
                break;
            }

            return(builder);
        }