Esempio n. 1
0
File: P.cs Progetto: zhuwansu/Rafy
 /// <summary>
 /// 扩展一个列表属性
 /// </summary>
 /// <typeparam name="TEntityList">The type of the entity list.</typeparam>
 /// <param name="propertyName">Name of the property.</param>
 /// <param name="declareType">Type of the declare.</param>
 /// <param name="meta">The meta.</param>
 /// <returns></returns>
 public static ListProperty <TEntityList> RegisterListExtension <TEntityList>(string propertyName, Type declareType, ListPropertyMeta meta)
     where TEntityList : EntityList
 {
     return(RegisterListExtensionCore <TEntityList>(propertyName, declareType, meta));
 }
Esempio n. 2
0
File: P.cs Progetto: zhuwansu/Rafy
        private static ListProperty <TEntityList> RegisterListExtensionCore <TEntityList>(string propertyName, Type declareType, ListPropertyMeta args)
            where TEntityList : EntityList
        {
            var meta = new ListPropertyMetadata <TEntityList>(args.DataProvider);

            var property = new ListProperty <TEntityList>(typeof(TEntity), declareType, propertyName, meta);

            property._hasManyType = args.HasManyType;

            ManagedPropertyRepository.Instance.RegisterProperty(property);

            return(property);
        }
Esempio n. 3
0
File: P.cs Progetto: zhuwansu/Rafy
 /// <summary>
 /// 注册一个列表属性
 /// </summary>
 /// <typeparam name="TEntityList"></typeparam>
 /// <param name="propertyExp"></param>
 /// <param name="meta"></param>
 /// <returns></returns>
 public static ListProperty <TEntityList> RegisterList <TEntityList>(Expression <Func <TEntity, TEntityList> > propertyExp, ListPropertyMeta meta)
     where TEntityList : EntityList
 {
     return(RegisterListCore <TEntityList>(GetPropertyName(propertyExp), meta));
 }