Ejemplo n.º 1
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>()));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
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));
        }