/// <summary> /// Initializes a new instance of the <see cref="CompartmentSearchExpression"/> class. /// </summary> /// <param name="compartmentType">The compartment type.</param> /// <param name="compartmentId">The compartment id.</param> public CompartmentSearchExpression(string compartmentType, string compartmentId) { EnsureArg.IsTrue(ModelInfoProvider.IsKnownCompartmentType(compartmentType), nameof(compartmentType)); EnsureArg.IsNotNullOrWhiteSpace(compartmentId, nameof(compartmentId)); CompartmentType = compartmentType; CompartmentId = compartmentId; }
/// <summary> /// Initializes a new instance of the <see cref="CompartmentSearchExpression"/> class. /// </summary> /// <param name="compartmentType">The compartment type.</param> /// <param name="compartmentId">The compartment id.</param> /// <param name="filteredResourceTypes">Resource types to filter</param> public CompartmentSearchExpression(string compartmentType, string compartmentId, params string[] filteredResourceTypes) { EnsureArg.IsTrue(ModelInfoProvider.IsKnownCompartmentType(compartmentType), nameof(compartmentType)); EnsureArg.IsNotNullOrWhiteSpace(compartmentId, nameof(compartmentId)); CompartmentType = compartmentType; CompartmentId = compartmentId; FilteredResourceTypes = filteredResourceTypes ?? Array.Empty <string>(); }
public bool Match(HttpContext httpContext, IRouter route, string routeKey, RouteValueDictionary values, RouteDirection routeDirection) { EnsureArg.IsNotNull(httpContext, nameof(httpContext)); EnsureArg.IsNotNull(route, nameof(route)); EnsureArg.IsNotNullOrEmpty(routeKey, nameof(routeKey)); EnsureArg.IsNotNull(values, nameof(values)); if (values.TryGetValue(KnownActionParameterNames.CompartmentType, out var compartmentTypeObj) && compartmentTypeObj is string compartmentType && !string.IsNullOrEmpty(compartmentType)) { return(ModelInfoProvider.IsKnownCompartmentType(compartmentType)); } return(false); }