예제 #1
0
 public OperationPath20(string value, OperationPath20 toCopy)
     : base(NormalizePaths(value, toCopy), IsValid)
 {
     foreach (var kv in toCopy._pathParameters)
     {
         _pathParameters.Add(kv.Key, kv.Value);
     }
 }
예제 #2
0
        public OperationDefinition20(OperationPath20 path, IServiceMetadata meta) : base(meta)
//        public OperationDefinition20(IServiceMetadata meta) : base(meta)
        {
            ConsumesOctetStream = false;
            Path                = path;
            Parameters          = new List <ParameterDefinition>();
            ProducesOctetStream = false;
        }
예제 #3
0
        private static string NormalizePaths(string basePath, OperationPath20 toCopy)
        {
            var operationPath = toCopy.ToString();

            if (basePath.EndsWith("/") && operationPath.StartsWith("/"))
            {
                operationPath = operationPath.Substring(1);
            }
            return(basePath + operationPath);
        }
예제 #4
0
        public static bool TryParse(string candidate, out OperationPath20 operationPath)
        {
            operationPath = null;

            if (!IsValid(candidate))
            {
                return(false);
            }

            operationPath = new OperationPath20(candidate);
            return(true);
        }