Ejemplo n.º 1
0
        public UriRewriteAction(UriRewriteActionDefinition parameters)
        {
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            Name       = DeliveryRuleActionType.UriRewrite;
        }
        internal static UriRewriteAction DeserializeUriRewriteAction(JsonElement element)
        {
            UriRewriteActionDefinition parameters = default;
            DeliveryRuleActionType     name       = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = UriRewriteActionDefinition.DeserializeUriRewriteActionDefinition(property.Value);
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = new DeliveryRuleActionType(property.Value.GetString());
                    continue;
                }
            }
            return(new UriRewriteAction(name, parameters));
        }
Ejemplo n.º 3
0
 internal UriRewriteAction(DeliveryRuleActionType name, UriRewriteActionDefinition parameters) : base(name)
 {
     Parameters = parameters;
     Name       = name;
 }