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


C# IPropertyInstance.CustomType方法代码示例

本文整理汇总了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>();
        }
开发者ID:Eskat0n,项目名称:Frameplate,代码行数:10,代码来源:EnumConvention.cs

示例2: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Property.PropertyType.Equals(typeof(IGeometry)))
     {
         instance.CustomType<SqLiteGeometryType>();
     }
 }
开发者ID:matanzg,项目名称:codecovered,代码行数:7,代码来源:SqLiteGeometryTypeConvention.cs

示例3: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Property.PropertyType.Equals(typeof(IGeometry)))
     {
         instance.CustomType<GeometryType>();
         instance.CustomSqlType("Geography");
     }
 }
开发者ID:matanzg,项目名称:codecovered,代码行数:8,代码来源:SqlServer2008GeographyTypeConvention.cs

示例4: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (typeof(IGeometry).IsAssignableFrom(instance.Property.PropertyType))
     {
         instance.CustomType(typeof(GeographyType));
         instance.CustomSqlType("GEOGRAPHY");
     }
 }
开发者ID:theriddlebrothers,项目名称:Honeypot,代码行数:8,代码来源:GeographyConvention.cs

示例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>();
        }
开发者ID:MatthewRudolph,项目名称:Airy,代码行数:13,代码来源:DateTimeOffsetSplitTypeConvention.cs

示例6: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Property.ToString().Contains("String"))
     {
         instance.CustomType("StringClob");
         instance.CustomSqlType("NTEXT");
         //instance.Length(4001);
     }
 }
开发者ID:bibliopedia,项目名称:bibliopedia,代码行数:9,代码来源:Conventions.cs

示例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);
        }
开发者ID:Mike343,项目名称:Netcoders,代码行数:13,代码来源:EnumConvention.cs

示例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>();

            }
        }
开发者ID:neozhu,项目名称:MrCMS,代码行数:18,代码来源:DateTimeConvention.cs

示例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);
     }
 }
开发者ID:neozhu,项目名称:MrCMS,代码行数:17,代码来源:StringLengthConvention.cs

示例10: Apply

 public void Apply(IPropertyInstance instance)
 {
     instance.CustomType("Ticks");
 }
开发者ID:ikutsin,项目名称:BinaryAnalysis.Core,代码行数:4,代码来源:DateTimeStorageConvention.cs

示例11: Apply

		public void Apply(IPropertyInstance instance)
		{
			instance.CustomType(instance.Property.PropertyType);
			// Enumerations can't be null
			instance.Not.Nullable();
		}
开发者ID:seatwave,项目名称:Quarks,代码行数:6,代码来源:CustomTypeEnum.cs

示例12: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Property.PropertyType == typeof(string))
         instance.CustomType("AnsiString");
 }
开发者ID:GutAmanai,项目名称:TG,代码行数:5,代码来源:FluentNHibernateConventions.cs

示例13: Apply

 public void Apply(IPropertyInstance instance)
 {
     instance.CustomType<int>();
     instance.Not.Nullable();
 }
开发者ID:ikutsin,项目名称:BinaryAnalysis.Core,代码行数:5,代码来源:EnumAsIntConvention.cs

示例14: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Property.PropertyType == typeof(TimeSpan))
         instance.CustomType("TimeAsTimeSpan");
 }
开发者ID:marcosli,项目名称:multi-vagas,代码行数:5,代码来源:PropertyConvention.cs

示例15: Apply

 public void Apply(IPropertyInstance instance)
 {
     if (instance.Type.IsEnum)
         instance.CustomType<int>();
 }
开发者ID:Eskat0n,项目名称:Wotstat,代码行数:5,代码来源:EnumIntConvention.cs


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