コード例 #1
0
ファイル: MapConvention.cs プロジェクト: fuhongliang/Jxc-1
        public void Apply(FluentNHibernate.Conventions.Instances.IPropertyInstance instance)
        {
            // instance.CustomType

            if (instance.Type.IsGenericType && instance.Type.GetGenericTypeDefinition() == tp)
            {
                var realType = instance.Type.GenericArguments.First();
                if (realType.IsEnum)
                {
                    instance.CustomType(realType);
                }

            }

            var list = instance.Property.MemberInfo.GetCustomAttributes(typeof(FieldLengthAttribute), true);
            if (list.Length > 0)
            {
                instance.Length(((FieldLengthAttribute)list[0]).Length);
            }
        }
コード例 #2
0
 public void Apply(FluentNHibernate.Conventions.Instances.IPropertyInstance instance)
 {
     instance.Length(int.MaxValue);
     //instance.CustomSqlType("image");//.CustomType("BinaryBlob");
 }