Пример #1
0
        public object Post(SetUserDataRequest request)
        {
            Log.Debug("starting Post(SetUserDataRequest request)");
            Log.Debug($"You sent me SetUserDataRequest = {request}");
            SetUserDataRequestPayload setUserDataRequestPayload = request.SetUserDataRequestPayload;

            Log.Debug($"You sent me SetUserDataRequestPayload = {setUserDataRequestPayload}, UserData = {request.SetUserDataRequestPayload.UserData}");
            // ToDo: turn this into a Task, and return the LongRunningtaskId
            // Get the BaseServicesData and diskAnalysisServicesData instances that were injected into the DI container
            var baseServicesData         = HostContext.TryResolve <BaseServicesData>();
            var diskAnalysisServicesData = HostContext.TryResolve <DiskAnalysisServicesData>();

            // Define the lambda that describes the task
            // Update the plugin's Data object's UserData
            if (request.SetUserDataRequestPayload.UserDataSave)
            {
                // Action to take if "save" is true
                diskAnalysisServicesData.UserData = request.SetUserDataRequestPayload.UserData;
            }
            //} else { // Action to take if "save" is false }

            // ToDo: Start the LongRunningTask
            // ToDo: return the LongRunningTaskId
            string result = "OK";

            Log.Debug($"leaving Post(SetUserDataRequest request), returning {result}");
            return(new SetUserDataResponse(new SetUserDataResponsePayload(result)));
        }
Пример #2
0
 public SetUserDataRequest(SetUserDataRequestPayload setUserDataRequestPayload)
 {
     SetUserDataRequestPayload = setUserDataRequestPayload;
 }