Пример #1
0
        /// <inheritdoc />
        public StoredProcedureParameterDefinition Definition(string connectorName, string procedureName, string parameterName, ILoggingService loggingService = null)
        {
            loggingService?.AddSprocToLogger(connectorName, procedureName, HttpMethodType.GET);
            IOperationResource resource = ResourceFactory.GetResource(connectorName, OperationType.Any, procedureName);

            return(resource.GetStoredProcedureDefinition(parameterName));
        }
Пример #2
0
        /// <inheritdoc />
        public IDictionary <string, object> ExecuteNoParameters(string connectorName, string procedureName, ILoggingService loggingService = null)
        {
            loggingService?.AddSprocToLogger(connectorName, procedureName, HttpMethodType.GET);
            IOperationResource resource = ResourceFactory.GetResource(connectorName, OperationType.read, procedureName);

            return(resource.ExecuteProc(new Dictionary <string, object>()));
        }
Пример #3
0
        /// <inheritdoc />
        public IDictionary <string, object> Execute <TViewModel>(string connectorName, string procedureName, TViewModel parameters, ILoggingService loggingService = null)
        {
            loggingService?.AddSprocToLogger(connectorName, procedureName, HttpMethodType.POST);
            IOperationResource           resource            = ResourceFactory.GetResource(connectorName, OperationType.read, procedureName);
            IDictionary <string, object> parameterDictionary = typeof(TViewModel)
                                                               .GetProperties(BindingFlags.Instance | BindingFlags.Public)
                                                               .ToDictionary(prop => prop.Name, prop => prop.GetValue(parameters, null));

            return(resource.ExecuteProc(parameterDictionary));
        }
Пример #4
0
        /// <inheritdoc />
        public IDictionary <string, object> Execute(string connectorName, string procedureName, JToken parameters, ILoggingService loggingService = null)
        {
            loggingService?.AddSprocToLogger(connectorName, procedureName, HttpMethodType.POST);
            Check.NotNull(parameters, nameof(parameters));

            IOperationResource           resource            = ResourceFactory.GetResource(connectorName, OperationType.read, procedureName);
            IDictionary <string, object> parameterDictionary = (IDictionary <string, object>)parameters.JTokenToConventionalDotNetObject();

            return(resource.ExecuteProc(parameterDictionary));
        }