本文整理汇总了C#中IPropertyInstance.CustomType方法的典型用法代码示例。如果您正苦于以下问题:C# IPropertyInstance.CustomType方法的具体用法?C# IPropertyInstance.CustomType怎么用?C# IPropertyInstance.CustomType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyInstance
的用法示例。
在下文中一共展示了IPropertyInstance.CustomType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Type.IsEnum == false)
return;
if (EnumType == EnumType.Integer)
instance.CustomType<int>();
else
instance.CustomType<string>();
}
示例2: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.PropertyType.Equals(typeof(IGeometry)))
{
instance.CustomType<SqLiteGeometryType>();
}
}
示例3: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.PropertyType.Equals(typeof(IGeometry)))
{
instance.CustomType<GeometryType>();
instance.CustomSqlType("Geography");
}
}
示例4: Apply
public void Apply(IPropertyInstance instance)
{
if (typeof(IGeometry).IsAssignableFrom(instance.Property.PropertyType))
{
instance.CustomType(typeof(GeographyType));
instance.CustomSqlType("GEOGRAPHY");
}
}
示例5: Apply
/// <summary>
/// The convention that is applied to a <see cref = "IPropertyInstance" /> when the criteria from the Accept method is meet.
/// </summary>
/// <param name="instance">An <see cref = "IPropertyInstance" /> to apply the convention to.</param>
public void Apply(IPropertyInstance instance)
{
if (instance == null)
{
throw new ArgumentNullException("instance");
}
instance.CustomType<DateTimeOffsetSplitType>();
}
示例6: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.ToString().Contains("String"))
{
instance.CustomType("StringClob");
instance.CustomSqlType("NTEXT");
//instance.Length(4001);
}
}
示例7: Apply
/// <summary>
/// Applies the specified instance.
/// </summary>
/// <param name="instance">The instance.</param>
public void Apply(IPropertyInstance instance)
{
if (instance == null)
{
throw new ArgumentNullException("instance");
}
instance.CustomType(instance.Property.PropertyType);
}
示例8: Apply
public void Apply(IPropertyInstance instance)
{
if (typeof(SiteEntity).IsAssignableFrom(instance.EntityType))
{
if (instance.Property.PropertyType == typeof(DateTime))
instance.CustomType<DateTimeData>();
else if (instance.Property.PropertyType == typeof(DateTime?))
instance.CustomType<NullableDateTimeData>();
}
else if (typeof(SystemEntity).IsAssignableFrom(instance.EntityType))
{
if (instance.Property.PropertyType == typeof(DateTime))
instance.CustomType<LocalDateTimeData>();
else if (instance.Property.PropertyType == typeof(DateTime?))
instance.CustomType<LocalNullableDateTimeData>();
}
}
示例9: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.PropertyType != typeof(string))
return;
var memberInfo = instance.Property.MemberInfo;
var stringLengthAttribute = memberInfo.GetCustomAttribute<StringLengthAttribute>();
var isDbLengthAttribute = memberInfo.GetCustomAttribute<IsDBLengthAttribute>();
if (stringLengthAttribute != null && isDbLengthAttribute != null)
{
instance.Length(stringLengthAttribute.MaximumLength);
}
else
{
instance.CustomType<VarcharMax>();
instance.Length(4001);
}
}
示例10: Apply
public void Apply(IPropertyInstance instance)
{
instance.CustomType("Ticks");
}
示例11: Apply
public void Apply(IPropertyInstance instance)
{
instance.CustomType(instance.Property.PropertyType);
// Enumerations can't be null
instance.Not.Nullable();
}
示例12: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.PropertyType == typeof(string))
instance.CustomType("AnsiString");
}
示例13: Apply
public void Apply(IPropertyInstance instance)
{
instance.CustomType<int>();
instance.Not.Nullable();
}
示例14: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Property.PropertyType == typeof(TimeSpan))
instance.CustomType("TimeAsTimeSpan");
}
示例15: Apply
public void Apply(IPropertyInstance instance)
{
if (instance.Type.IsEnum)
instance.CustomType<int>();
}