Exemplo n.º 1
0
 internal UriRewriteActionProperties(UriRewriteActionType actionType, string sourcePattern, string destination, bool?preserveUnmatchedPath)
 {
     ActionType            = actionType;
     SourcePattern         = sourcePattern;
     Destination           = destination;
     PreserveUnmatchedPath = preserveUnmatchedPath;
 }
Exemplo n.º 2
0
 internal UriRewriteActionDefinition(UriRewriteActionType typeDefinition, string sourcePattern, string destination, bool?preserveUnmatchedPath)
 {
     TypeDefinition        = typeDefinition;
     SourcePattern         = sourcePattern;
     Destination           = destination;
     PreserveUnmatchedPath = preserveUnmatchedPath;
 }
Exemplo n.º 3
0
        public UriRewriteActionProperties(UriRewriteActionType actionType, string sourcePattern, string destination)
        {
            if (sourcePattern == null)
            {
                throw new ArgumentNullException(nameof(sourcePattern));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            ActionType    = actionType;
            SourcePattern = sourcePattern;
            Destination   = destination;
        }
Exemplo n.º 4
0
        public UriRewriteActionDefinition(UriRewriteActionType typeDefinition, string sourcePattern, string destination)
        {
            if (sourcePattern == null)
            {
                throw new ArgumentNullException(nameof(sourcePattern));
            }
            if (destination == null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            TypeDefinition = typeDefinition;
            SourcePattern  = sourcePattern;
            Destination    = destination;
        }
Exemplo n.º 5
0
        internal static UriRewriteActionProperties DeserializeUriRewriteActionProperties(JsonElement element)
        {
            UriRewriteActionType typeName         = default;
            string          sourcePattern         = default;
            string          destination           = default;
            Optional <bool> preserveUnmatchedPath = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("typeName"))
                {
                    typeName = new UriRewriteActionType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("sourcePattern"))
                {
                    sourcePattern = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("destination"))
                {
                    destination = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("preserveUnmatchedPath"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    preserveUnmatchedPath = property.Value.GetBoolean();
                    continue;
                }
            }
            return(new UriRewriteActionProperties(typeName, sourcePattern, destination, Optional.ToNullable(preserveUnmatchedPath)));
        }