Exemplo n.º 1
0
 /// <summary>
 /// Generates the right OperationName string for a given <see cref="RestierOperationMethod"/> and <see cref="RestierPipelineState"/>.
 /// </summary>
 /// <param name="operation">The <see cref="RestierOperationMethod"/> to determine the method name for.</param>
 /// <param name="restierPipelineState">The <see cref="RestierPipelineState"/> to determine the method name for.</param>
 /// <returns>A string containing the corrected OperationName, accounting for what the suffix will end up being.</returns>
 internal static string GetRestierOperationNameInternal(RestierOperationMethod operation, RestierPipelineState restierPipelineState)
 {
     return(GetRestierOperationNameInternal(operation.ToString(), restierPipelineState));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Generates the complete MethodName for a given <see cref="IEdmOperationImport"/>, <see cref="RestierPipelineState"/>, and <see cref="RestierEntitySetOperation"/>.
        /// </summary>
        /// <param name="operationName">The <see cref="string"/> containing the name of the operation.</param>
        /// <param name="restierPipelineState">The part of the Restier pipeline currently executing.</param>
        /// <param name="restierOperation">The <see cref="RestierOperationMethod"/> currently being executed.</param>
        /// <returns>A string representing the fully-realized MethodName.</returns>
        private static string GetFunctionMethodNameInternal(string operationName, RestierPipelineState restierPipelineState, RestierOperationMethod restierOperation)
        {
            if (restierPipelineState == RestierPipelineState.Submit && ExcludedMethodSubmitOperations.Contains(restierOperation))
            {
                return(string.Empty);
            }

            var prefix = GetPipelinePrefixInternal(restierPipelineState);

            //RWM: If, for some reason, we don't have a prefix, then we don't have a method for this operation. So don't do anything.
            if (string.IsNullOrWhiteSpace(prefix))
            {
                return(string.Empty);
            }

            var restierOperationName = GetRestierOperationNameInternal(restierOperation, restierPipelineState);
            var suffix = GetPipelineSuffixInternal(restierPipelineState);

            return($"{prefix}{restierOperationName}{suffix}{operationName}");
        }
Exemplo n.º 3
0
 /// <summary>
 /// Generates the complete MethodName for a given <see cref="IEdmOperationImport"/>, <see cref="RestierPipelineState"/>, and <see cref="RestierEntitySetOperation"/>.
 /// </summary>
 /// <param name="operationImport">The <see cref="IEdmOperationImport"/> to generate a name for.</param>
 /// <param name="restierPipelineState">The part of the Restier pipeline currently executing.</param>
 /// <param name="restierOperation">The <see cref="RestierOperationMethod"/> currently being executed.</param>
 /// <returns>A string representing the fully-realized MethodName.</returns>
 public static string GetFunctionMethodName(IEdmOperationImport operationImport, RestierPipelineState restierPipelineState, RestierOperationMethod restierOperation)
 {
     return(GetFunctionMethodNameInternal(operationImport.Operation.Name, restierPipelineState, restierOperation));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Generates the complete MethodName for a given <see cref="OperationContext"/>, <see cref="RestierPipelineState"/>, and <see cref="RestierEntitySetOperation"/>.
 /// </summary>
 /// <param name="operationImport">The <see cref="OperationContext"/> to generate a name for.</param>
 /// <param name="restierPipelineState">The part of the Restier pipeline currently executing.</param>
 /// <param name="restierOperation">The <see cref="RestierOperationMethod"/> currently being executed.</param>
 /// <returns>A string representing the fully-realized MethodName.</returns>
 public static string GetFunctionMethodName(OperationContext operationImport, RestierPipelineState restierPipelineState, RestierOperationMethod restierOperation)
 {
     if (operationImport == null)
     {
         return(string.Empty);
     }
     return(GetFunctionMethodNameInternal(operationImport.OperationName, restierPipelineState, restierOperation));
 }
Exemplo n.º 5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="name"></param>
 /// <param name="pipelineState"></param>
 /// <param name="methodName"></param>
 /// <param name="methodOperation"></param>
 public RestierConventionMethodDefinition(string name, RestierPipelineState pipelineState, string methodName, RestierOperationMethod methodOperation)
     : base(name, pipelineState)
 {
     MethodName      = methodName;
     MethodOperation = methodOperation;
 }