当前位置: 首页>>代码示例>>C#>>正文


C# PrimitivePropertyConfiguration类代码示例

本文整理汇总了C#中PrimitivePropertyConfiguration的典型用法代码示例。如果您正苦于以下问题:C# PrimitivePropertyConfiguration类的具体用法?C# PrimitivePropertyConfiguration怎么用?C# PrimitivePropertyConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PrimitivePropertyConfiguration类属于命名空间,在下文中一共展示了PrimitivePropertyConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HasColumnOrder_should_throw_when_argument_out_of_range

        public void HasColumnOrder_should_throw_when_argument_out_of_range()
        {
            var configuration = new PrimitivePropertyConfiguration<PrimitivePropertyConfiguration>(new PrimitivePropertyConfiguration());

            Assert.Equal(
                new ArgumentOutOfRangeException("columnOrder").Message,
                Assert.Throws<ArgumentOutOfRangeException>(() => configuration.HasColumnOrder(-1)).Message);
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:8,代码来源:PrimitivePropertyConfigurationTests.cs

示例2: Apply_should_set_store_generated_pattern

        public void Apply_should_set_store_generated_pattern()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration();

            new DatabaseGeneratedAttributeConvention()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new DatabaseGeneratedAttribute(DatabaseGeneratedOption.None));

            Assert.Equal(DatabaseGeneratedOption.None, propertyConfiguration.DatabaseGeneratedOption);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:9,代码来源:DatabaseGeneratedAttributeConventionTests.cs

示例3: CopyFrom

 internal override void CopyFrom(PrimitivePropertyConfiguration other)
 {
     base.CopyFrom(other);
     var strConfigRhs = other as DateTimePropertyConfiguration;
     if (strConfigRhs != null)
     {
         Precision = strConfigRhs.Precision;
     }
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:9,代码来源:DateTimePropertyConfiguration.cs

示例4: CopyFrom

 internal override void CopyFrom(PrimitivePropertyConfiguration other)
 {
     base.CopyFrom(other);
     var strConfigRhs = other as BinaryPropertyConfiguration;
     if (strConfigRhs != null)
     {
         IsRowVersion = strConfigRhs.IsRowVersion;
     }
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:9,代码来源:BinaryPropertyConfiguration.cs

示例5: Apply_should_ignore_attribute_if_already_set

        public void Apply_should_ignore_attribute_if_already_set()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration { DatabaseGeneratedOption = DatabaseGeneratedOption.Computed };

            new DatabaseGeneratedAttributeConvention.DatabaseGeneratedAttributeConventionImpl()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new DatabaseGeneratedAttribute(DatabaseGeneratedOption.None));

            Assert.Equal(DatabaseGeneratedOption.Computed, propertyConfiguration.DatabaseGeneratedOption);
        }
开发者ID:jimmy00784,项目名称:entityframework,代码行数:9,代码来源:DatabaseGeneratedAttributeConventionTests.cs

示例6: Apply_should_set_concurrency_token

        public void Apply_should_set_concurrency_token()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration();

            new ConcurrencyCheckAttributeConvention.ConcurrencyCheckAttributeConventionImpl()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new ConcurrencyCheckAttribute());

            Assert.Equal(EdmConcurrencyMode.Fixed, propertyConfiguration.ConcurrencyMode);
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:9,代码来源:ConcurrencyCheckAttributeConventionTests.cs

示例7: Apply_should_ignore_attribute_if_already_set

        public void Apply_should_ignore_attribute_if_already_set()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration { ConcurrencyMode = EdmConcurrencyMode.None };

            new ConcurrencyCheckAttributeConvention.ConcurrencyCheckAttributeConventionImpl()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new ConcurrencyCheckAttribute());

            Assert.Equal(EdmConcurrencyMode.None, propertyConfiguration.ConcurrencyMode);
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:9,代码来源:ConcurrencyCheckAttributeConventionTests.cs

示例8: Apply_should_not_set_column_name_when_already_set

        public void Apply_should_not_set_column_name_when_already_set()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration { ColumnName = "Bar" };

            new ColumnAttributeConvention.ColumnAttributeConventionImpl()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new ColumnAttribute("Foo"));

            Assert.Equal("Bar", propertyConfiguration.ColumnName);
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:9,代码来源:ColumnAttributeConventionTests.cs

示例9: CopyFrom

 internal override void CopyFrom(PrimitivePropertyConfiguration other)
 {
     base.CopyFrom(other);
     var strConfigRhs = other as StringPropertyConfiguration;
     if (strConfigRhs != null)
     {
         IsUnicode = strConfigRhs.IsUnicode;
     }
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:9,代码来源:StringPropertyConfiguration.cs

示例10: HasDatabaseGeneratedOption_should_throw_when_argument_out_of_range

        public void HasDatabaseGeneratedOption_should_throw_when_argument_out_of_range()
        {
            var configuration = new PrimitivePropertyConfiguration<PrimitivePropertyConfiguration>(new PrimitivePropertyConfiguration());

            Assert.Equal(
                new ArgumentOutOfRangeException("databaseGeneratedOption").Message,
                Assert.Throws<ArgumentOutOfRangeException>(() => configuration.HasDatabaseGeneratedOption((DatabaseGeneratedOption?)(-1))).
                    Message);
        }
开发者ID:jwanagel,项目名称:jjwtest,代码行数:9,代码来源:PrimitivePropertyConfigurationTests.cs

示例11: Apply_should_set_column_name

        public void Apply_should_set_column_name()
        {
            var propertyConfiguration = new PrimitivePropertyConfiguration();

            new ColumnAttributeConvention.ColumnAttributeConventionImpl()
                .Apply(new MockPropertyInfo(), propertyConfiguration, new ColumnAttribute("Foo"));

            Assert.Equal("Foo", propertyConfiguration.ColumnName);
        }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:9,代码来源:ColumnAttributeConventionTests.cs

示例12: IsCompatible

        internal override bool IsCompatible(PrimitivePropertyConfiguration other, bool inCSpace, out string errorMessage)
        {
            var dateRhs = other as DateTimePropertyConfiguration;

            var baseIsCompatible = base.IsCompatible(other, inCSpace, out errorMessage);
            var precisionIsCompatible = dateRhs == null || IsCompatible(c => c.Precision, dateRhs, ref errorMessage);

            return baseIsCompatible &&
                   precisionIsCompatible;
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:DateTimePropertyConfiguration.cs

示例13: FillFrom

 internal override void FillFrom(PrimitivePropertyConfiguration other, bool inCSpace)
 {
     base.FillFrom(other, inCSpace);
     var strConfigRhs = other as DateTimePropertyConfiguration;
     if (strConfigRhs != null
         && Precision == null)
     {
         Precision = strConfigRhs.Precision;
     }
 }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:DateTimePropertyConfiguration.cs

示例14: FillFrom

 public override void FillFrom(PrimitivePropertyConfiguration other, bool inCSpace)
 {
     base.FillFrom(other, inCSpace);
     var strConfigRhs = other as BinaryPropertyConfiguration;
     if (strConfigRhs != null
         && IsRowVersion == null)
     {
         IsRowVersion = strConfigRhs.IsRowVersion;
     }
 }
开发者ID:WangWilliam,项目名称:EntityFramework5,代码行数:10,代码来源:BinaryPropertyConfiguration.cs

示例15: HasParameterName_should_set_name_on_inner_configuration

        public void HasParameterName_should_set_name_on_inner_configuration()
        {
            var innerConfiguration = CreateConfiguration();
            var primitivePropertyConfiguration 
                = new PrimitivePropertyConfiguration<PrimitivePropertyConfiguration>(innerConfiguration);

            primitivePropertyConfiguration.HasParameterName("Foo");

            Assert.Equal("Foo", innerConfiguration.ParameterName);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:PrimitivePropertyConfigurationTests.cs


注:本文中的PrimitivePropertyConfiguration类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。