Ejemplo n.º 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();
        }
Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
 public static TypeEntity ToTypeEntity(this Type type)
 {
     return(TypeEntity.ToTypeDNFunc(type));
 }
Ejemplo n.º 4
0
        public static List<QueryEntity> GetTypeQueries(TypeEntity typeEntity)
        {
            Type type = TypeLogic.GetType(typeEntity.CleanName);

            return DynamicQueryManager.Current.GetTypeQueries(type).Keys.Select(GetQueryEntity).ToList();
        }
Ejemplo n.º 5
0
 public static Type ToType(this TypeEntity type)
 {
     return(TypeEntity.ToTypeFunc(type));
 }
Ejemplo n.º 6
0
 public List<string> GetLiteralsFromDataObjectProvider(TypeEntity type)
 {
     return Return(MethodInfo.GetCurrentMethod(),
         () => SMSLogic.GetLiteralsFromDataObjectProvider(type.ToType()));
 }
Ejemplo n.º 7
0
 public OperationRulePack GetOperationRules(Lite<RoleEntity> role, TypeEntity typeEntity)
 {
     return Return(MethodInfo.GetCurrentMethod(),
       () => OperationAuthLogic.GetOperationRules(role, typeEntity));
 }
Ejemplo n.º 8
0
 public QueryRulePack GetQueryRules(Lite<RoleEntity> role, TypeEntity typeEntity)
 {
     return Return(MethodInfo.GetCurrentMethod(),
       () => QueryAuthLogic.GetQueryRules(role, typeEntity));
 }
Ejemplo n.º 9
0
 public static PropertyRouteEntity TryGetPropertyRouteEntity(TypeEntity entity, string path)
 {
     return Properties.Value.TryGetC(entity)?.TryGetC(path);
 }
Ejemplo n.º 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();
        }