• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# PrimitivePropertyConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: HasParameterName_configures_when_unset

        public void HasParameterName_configures_when_unset()
        {
            var innerConfig = new PrimitivePropertyConfiguration();
            var config = new LightweightPropertyConfiguration(new MockPropertyInfo(), () => innerConfig);

            var result = config.HasParameterName("Parameter1");

            Assert.Equal("Parameter1", innerConfig.ParameterName);
            Assert.Same(config, result);
        }
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:LightweightPropertyConfigurationTests.cs


示例17: IsCompatible

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

            var baseIsCompatible = base.IsCompatible(other, inCSpace, out errorMessage);
            var isUnicodeIsCompatible = stringRhs == null || IsCompatible(c => c.IsUnicode, stringRhs, ref errorMessage);

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


示例18: CopyFrom

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


示例19: FillFrom

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


示例20: MakeCompatibleWith

        internal override void MakeCompatibleWith(PrimitivePropertyConfiguration other, bool inCSpace)
        {
            DebugCheck.NotNull(other);

            base.MakeCompatibleWith(other, inCSpace);

            var stringPropertyConfiguration = other as StringPropertyConfiguration;

            if (stringPropertyConfiguration == null) return;
            if (stringPropertyConfiguration.IsUnicode != null) IsUnicode = null;
        }
开发者ID:Cireson,项目名称:EntityFramework6,代码行数:11,代码来源:StringPropertyConfiguration.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PrimitiveType类代码示例发布时间:2022-05-24
下一篇:
C# PrimitiveExpression类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap