本文整理汇总了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);
}
示例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);
}
示例3: CopyFrom
internal override void CopyFrom(PrimitivePropertyConfiguration other)
{
base.CopyFrom(other);
var strConfigRhs = other as DateTimePropertyConfiguration;
if (strConfigRhs != null)
{
Precision = strConfigRhs.Precision;
}
}
示例4: CopyFrom
internal override void CopyFrom(PrimitivePropertyConfiguration other)
{
base.CopyFrom(other);
var strConfigRhs = other as BinaryPropertyConfiguration;
if (strConfigRhs != null)
{
IsRowVersion = strConfigRhs.IsRowVersion;
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例9: CopyFrom
internal override void CopyFrom(PrimitivePropertyConfiguration other)
{
base.CopyFrom(other);
var strConfigRhs = other as StringPropertyConfiguration;
if (strConfigRhs != null)
{
IsUnicode = strConfigRhs.IsUnicode;
}
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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);
}