public MyCustomController() { /*string configFile = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\GlobalConfiguration.json"; * MyAppGlobalLib.GlobalConfigReader myConfig = new MyAppGlobalLib.GlobalConfigReader(); * RESTConfig = myConfig.Load(configFile).RESTConfig;*/ //GetConfig c = new GetConfig(); var config = GetConfigRest.GetInstance(); RESTConfig = config.RESTConfig; }
public RESTTagDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTTagEmployeeDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTOrderDetailsDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTCustomerCustomerDemoDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTTerritoriesDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTCategoriesDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTRegionDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTSuppliersDB(RESTConfig restConfig) { this.restConfig = restConfig; }
private async Task <string> CallServiceAsync(string url, string method, string queryString, object input, Dictionary <string, string> headers, string id) { var result = string.Empty; Activity activity = null; var restConfig = new RESTConfig { Body = input == null ? null: JsonConvert.SerializeObject(input), Headers = headers, Method = method, QueryString = queryString, Url = url }; var workflowContext = await GetCurrentContext(); if (workflowContext != null && workflowContext.Status == Status.STARTED) { var status = GetStatus(Model.ActivityType.Task, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, id, workflowContext); if (status == Status.NONE) { var decisionRequest = new RespondDecisionTaskCompletedRequest { TaskToken = workflowContext.ReferenceToken, Decisions = new List <Decision> { new Decision { DecisionType = DecisionType.ScheduleActivityTask, ScheduleActivityTaskDecisionAttributes = new ScheduleActivityTaskDecisionAttributes { Input = JsonConvert.SerializeObject(restConfig), ActivityId = id, Control = id, ActivityType = new Amazon.SimpleWorkflow.Model.ActivityType { Name = Constants.LAMBDA_BIZ_ACTIVITY_TYPE, Version = Constants.LAMBDA_BIZ_TYPE_VERSION }, TaskList = new TaskList { Name = Constants.LAMBDA_BIZ_TASK_LIST + _orchestrationId }, StartToCloseTimeout = "NONE", ScheduleToCloseTimeout = "NONE", ScheduleToStartTimeout = "NONE", HeartbeatTimeout = "NONE" }, } } }; await _amazonSimpleWorkflowClient.RespondDecisionTaskCompletedAsync(decisionRequest); } else { await SetMarker(Model.ActivityType.Task, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, id, status, workflowContext.ReferenceToken); await RaiseEventAsync(Constants.LAMBDA_BIZ_EVENT, _orchestrationId, Constants.LAMBDA_BIZ_EVENT); activity = FindActivity(Model.ActivityType.Task, id, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, workflowContext.Activities); } if (status == Status.NONE || status == Status.SCHEDULED || status == Status.STARTED) { var waitStatus = Status.NONE; Workflow workflowWaitContext = null; do { workflowWaitContext = await GetCurrentContext(); waitStatus = GetStatus(Model.ActivityType.Task, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, id, workflowWaitContext); await SetMarker(Model.ActivityType.Task, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, id, waitStatus, workflowWaitContext.ReferenceToken); await RaiseEventAsync(Constants.LAMBDA_BIZ_EVENT, _orchestrationId, Constants.LAMBDA_BIZ_EVENT); }while (waitStatus != Status.SUCCEEDED && waitStatus != Status.FAILED && waitStatus != Status.TIMEOUT); activity = FindActivity(Model.ActivityType.Task, id, Constants.LAMBDA_BIZ_ACTIVITY_TYPE, workflowWaitContext.Activities); } } if (activity.Status == Status.FAILED) { throw new Exception(activity.FailureDetails); } if (activity.Status == Status.TIMEOUT) { throw new Exception("Time-Out"); } result = activity.Result; return(result); }
public RESTProductsDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTShippersDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTEmployeesDB(RESTConfig restConfig) { this.restConfig = restConfig; }
public RESTCustomerDemographicsDB(RESTConfig restConfig) { this.restConfig = restConfig; }