public static PropertyRulePack GetPropertyRules(Lite <RoleEntity> role, TypeEntity typeEntity) { var result = new PropertyRulePack { Role = role, Type = typeEntity }; cache.GetRules(result, PropertyRouteLogic.RetrieveOrGenerateProperties(typeEntity)); var coercer = PropertyCoercer.Instance.GetCoerceValue(role); result.Rules.ForEach(r => r.CoercedValues = EnumExtensions.GetValues <PropertyAllowed>() .Where(a => !coercer(PropertyRouteEntity.ToPropertyRouteFunc(r.Resource), a).Equals(a)) .ToArray()); return(result); }
static PropertyRoute ToPropertyRouteImplementation(PropertyRouteEntity route) { return(PropertyRoute.Parse(TypeLogic.EntityToType[route.RootType], route.Path)); }
public static bool IsPropertyRoute(this PropertyRouteEntity prdn, PropertyRoute pr) { return(IsPropertyRouteExpression.Evaluate(prdn, pr)); }
static PropertyRoute ToPropertyRouteImplementation(PropertyRouteEntity route) { return(PropertyRoute.Parse(TypeLogic.EntityToType.GetOrThrow(route.RootType), route.Path)); }
public static bool IsPropertyRoute(this PropertyRouteEntity prdn, PropertyRoute pr) => As.Expression(() => prdn.RootType == pr.RootType.ToTypeEntity() && prdn.Path == pr.PropertyString());
public string ParentType(PropertyRouteEntity pr) { return(pr.ToPropertyRoute().Parent.Type.Name); }
public static PropertyRoute ToPropertyRoute(this PropertyRouteEntity route) { return(PropertyRoute.Parse(TypeLogic.DnToType[route.RootType], route.Path)); }
public string RouteTypeName([Required, FromBody] PropertyRouteEntity pr) { return(pr.ToPropertyRoute().Type.Name); }