コード例 #1
0
        public static List<PropertyRouteEntity> RetrieveOrGenerateProperties(TypeEntity typeEntity)
        {
            var retrieve = Database.Query<PropertyRouteEntity>().Where(f => f.RootType == typeEntity).ToDictionary(a => a.Path);
            var generate = GenerateProperties(TypeLogic.DnToType[typeEntity], typeEntity).ToDictionary(a => a.Path);

            return generate.Select(kvp => retrieve.TryGetC(kvp.Key)?.Do(pi => pi.Route = kvp.Value.Route) ?? kvp.Value).ToList();
        }
コード例 #2
0
 public static List<PropertyRouteEntity> GenerateProperties(Type type, TypeEntity typeEntity)
 {
     return PropertyRoute.GenerateRoutes(type).Select(pr =>
         new PropertyRouteEntity
         {
             Route = pr,
             RootType = typeEntity,
             Path = pr.PropertyString()
         }).ToList();
 }
コード例 #3
0
 public static TypeEntity ToTypeEntity(this Type type)
 {
     return(TypeEntity.ToTypeDNFunc(type));
 }
コード例 #4
0
ファイル: QueryLogic.cs プロジェクト: JackWangCUMT/extensions
        public static List<QueryEntity> GetTypeQueries(TypeEntity typeEntity)
        {
            Type type = TypeLogic.GetType(typeEntity.CleanName);

            return DynamicQueryManager.Current.GetTypeQueries(type).Keys.Select(GetQueryEntity).ToList();
        }
コード例 #5
0
 public static Type ToType(this TypeEntity type)
 {
     return(TypeEntity.ToTypeFunc(type));
 }
コード例 #6
0
 public List<string> GetLiteralsFromDataObjectProvider(TypeEntity type)
 {
     return Return(MethodInfo.GetCurrentMethod(),
         () => SMSLogic.GetLiteralsFromDataObjectProvider(type.ToType()));
 }
コード例 #7
0
 public OperationRulePack GetOperationRules(Lite<RoleEntity> role, TypeEntity typeEntity)
 {
     return Return(MethodInfo.GetCurrentMethod(),
       () => OperationAuthLogic.GetOperationRules(role, typeEntity));
 }
コード例 #8
0
 public QueryRulePack GetQueryRules(Lite<RoleEntity> role, TypeEntity typeEntity)
 {
     return Return(MethodInfo.GetCurrentMethod(),
       () => QueryAuthLogic.GetQueryRules(role, typeEntity));
 }
コード例 #9
0
 public static PropertyRouteEntity TryGetPropertyRouteEntity(TypeEntity entity, string path)
 {
     return Properties.Value.TryGetC(entity)?.TryGetC(path);
 }
コード例 #10
0
        public TypeRuleBuilder(TypeAllowedRule rule)
        {
            this.allowed = new TypeAllowedBuilder(rule.Allowed.Fallback);
            this.conditions = rule.Allowed.Conditions.Select(c => new TypeConditionRuleBuilder(c.TypeCondition, c.Allowed)).ToMList();
            this.availableConditions = rule.AvailableConditions;
            this.allowedBase = rule.AllowedBase;
            this.resource = rule.Resource;

            this.properties = rule.Properties;
            this.operations = rule.Operations;
            this.queries = rule.Queries;

            this.RebindEvents();
        }