Пример #1
0
        public IActionResult Configuration()
        {
            var model = new EditConfigurationRequestModel();

            model.Configuration = jsonDatabaseService.ReadConfiguration();
            return(View(model));
        }
Пример #2
0
 public IActionResult Configuration(EditConfigurationRequestModel model)
 {
     if (!jsonDatabaseService.SaveConfiguration(model.Configuration, out string error))
     {
         ModelState.AddModelError(nameof(model.Configuration), error);
         return(View(model));
     }
     return(RedirectToAction(nameof(Configuration)));
 }