public DemoPluginSettings UpdateDemoData([FromBody] DemoPluginSettings request)
        {
            GlobalSettings.FormData1  = request.FormData1;
            GlobalSettings.FormData2  = request.FormData2;
            GlobalSettings.TestDate   = request.TestDate;
            GlobalSettings.UpdateTime = DateTime.UtcNow;

            return(GlobalSettings);
        }
 public DemoController()
 {
     if (GlobalSettings == null)
     {
         GlobalSettings            = new DemoPluginSettings();
         GlobalSettings.FormData1  = "FormData1-Default";
         GlobalSettings.FormData2  = "FormData2-Default";
         GlobalSettings.TestDate   = DateTime.Now;
         GlobalSettings.UpdateTime = DateTime.UtcNow;
     }
 }
Exemple #3
0
        public DemoPluginSettings GetDataForDemoUpdate([FromBody] UpdateRequestInfo <DemoPluginSettings> request)
        {
            if (GlobalSettings == null)
            {
                GlobalSettings            = new DemoPluginSettings();
                GlobalSettings.FormData1  = "FormData1-Default";
                GlobalSettings.FormData2  = "FormData2-Default";
                GlobalSettings.TestDate   = DateTime.Now;
                GlobalSettings.UpdateTime = DateTime.UtcNow;
            }

            if (request.Method == PluginRequestMethod.Update)
            {
                GlobalSettings.FormData1  = request.Body.FormData1;
                GlobalSettings.FormData2  = request.Body.FormData2;
                GlobalSettings.TestDate   = request.Body.TestDate;
                GlobalSettings.UpdateTime = DateTime.UtcNow;
            }

            return(GlobalSettings);
        }