Example #1
0
File: P.cs Project: zhuwansu/Rafy
        private static LOBProperty <TProperty> RegisterLOBCore <TProperty>(string propertyName, PropertyMetadata <TProperty> defaultMeta)
            where TProperty : class
        {
            var mp = new LOBProperty <TProperty>(typeof(TEntity), propertyName, defaultMeta);

            var propertyType = typeof(TProperty);

            if (propertyType == typeof(string))
            {
                mp.LOBType = LOBType.String;
                defaultMeta.DefaultValue = (TProperty)(object)PropertyDefailtValues.DefaultLOBString;
            }
            else
            {
                mp.LOBType = LOBType.Binary;
                defaultMeta.DefaultValue = (TProperty)(object)PropertyDefailtValues.DefaultLOBBinary;
            }

            ManagedPropertyRepository.Instance.RegisterProperty(mp);

            return(mp);
        }
 /// <summary>
 /// 获取指定的 LOB 属性的值。(懒加载)
 /// </summary>
 /// <typeparam name="T"></typeparam>
 /// <param name="property"></param>
 /// <returns></returns>
 public T GetLOBProperty <T>(LOBProperty <T> property)
     where T : class
 {
     return(this.GetLOBProperty(property as ILOBProperty) as T);
 }