Пример #1
0
        public static ModelBuilderTest.TestIndexBuilder ForSqlServerIsClustered(
            this ModelBuilderTest.TestIndexBuilder builder, bool clustered = true)
        {
            var indexBuilder = builder.GetInfrastructure();

            indexBuilder.ForSqlServerIsClustered(clustered);
            return(builder);
        }
    public static ModelBuilderTest.TestIndexBuilder <TEntity> HasName <TEntity>(
        this ModelBuilderTest.TestIndexBuilder <TEntity> builder,
        string name)
    {
        switch (builder)
        {
        case IInfrastructure <KeyBuilder <TEntity> > genericBuilder:
            genericBuilder.Instance.HasName(name);
            break;

        case IInfrastructure <KeyBuilder> nongenericBuilder:
            nongenericBuilder.Instance.HasName(name);
            break;
        }

        return(builder);
    }
    public static ModelBuilderTest.TestIndexBuilder <TEntity> HasFilter <TEntity>(
        this ModelBuilderTest.TestIndexBuilder <TEntity> builder,
        string filterExpression)
    {
        switch (builder)
        {
        case IInfrastructure <IndexBuilder <TEntity> > genericBuilder:
            genericBuilder.Instance.HasFilter(filterExpression);
            break;

        case IInfrastructure <IndexBuilder> nongenericBuilder:
            nongenericBuilder.Instance.HasFilter(filterExpression);
            break;
        }

        return(builder);
    }
Пример #4
0
    public static ModelBuilderTest.TestIndexBuilder <TEntity> IsClustered <TEntity>(
        this ModelBuilderTest.TestIndexBuilder <TEntity> builder,
        bool clustered = true)
    {
        switch (builder)
        {
        case IInfrastructure <IndexBuilder <TEntity> > genericBuilder:
            genericBuilder.Instance.IsClustered(clustered);
            break;

        case IInfrastructure <IndexBuilder> nongenericBuilder:
            nongenericBuilder.Instance.IsClustered(clustered);
            break;
        }

        return(builder);
    }