示例#1
0
        public static ModelBuilderTest.TestPropertyBuilder <TProperty> ForSqlServerHasColumnName <TProperty>(
            this ModelBuilderTest.TestPropertyBuilder <TProperty> builder, string name)
        {
            var genericBuilder = (builder as IInfrastructure <PropertyBuilder <TProperty> >)?.Instance;

            if (genericBuilder != null)
            {
                genericBuilder.ForSqlServerHasColumnName(name);
            }

            return(builder);
        }
    public static ModelBuilderTest.TestPropertyBuilder <TProperty> IsFixedLength <TProperty>(
        this ModelBuilderTest.TestPropertyBuilder <TProperty> builder,
        bool fixedLength = true)
    {
        switch (builder)
        {
        case IInfrastructure <PropertyBuilder <TProperty> > genericBuilder:
            genericBuilder.Instance.IsFixedLength(fixedLength);
            break;

        case IInfrastructure <PropertyBuilder> nongenericBuilder:
            nongenericBuilder.Instance.IsFixedLength(fixedLength);
            break;
        }

        return(builder);
    }
    public static ModelBuilderTest.TestPropertyBuilder <TProperty> HasColumnName <TProperty>(
        this ModelBuilderTest.TestPropertyBuilder <TProperty> builder,
        string name)
    {
        switch (builder)
        {
        case IInfrastructure <PropertyBuilder <TProperty> > genericBuilder:
            genericBuilder.Instance.HasColumnName(name);
            break;

        case IInfrastructure <PropertyBuilder> nongenericBuilder:
            nongenericBuilder.Instance.HasColumnName(name);
            break;
        }

        return(builder);
    }
    public static ModelBuilderTest.TestPropertyBuilder <TProperty> HasDefaultValue <TProperty>(
        this ModelBuilderTest.TestPropertyBuilder <TProperty> builder,
        object value)
    {
        switch (builder)
        {
        case IInfrastructure <PropertyBuilder <TProperty> > genericBuilder:
            genericBuilder.Instance.HasDefaultValue(value);
            break;

        case IInfrastructure <PropertyBuilder> nongenericBuilder:
            nongenericBuilder.Instance.HasDefaultValue(value);
            break;
        }

        return(builder);
    }
示例#5
0
    public static ModelBuilderTest.TestPropertyBuilder <TProperty> ToJsonProperty <TProperty>(
        this ModelBuilderTest.TestPropertyBuilder <TProperty> builder,
        string name)
    {
        switch (builder)
        {
        case IInfrastructure <PropertyBuilder <TProperty> > genericBuilder:
            genericBuilder.Instance.ToJsonProperty(name);
            break;

        case IInfrastructure <PropertyBuilder> nonGenericBuilder:
            nonGenericBuilder.Instance.ToJsonProperty(name);
            break;
        }

        return(builder);
    }