public async Task <IActionResult> Create(YanexXMLModuleViewModel viewModel) { var modul = _modulRegistry.CreateModule <YandexXMLModule>(_context, YandexXMLModule.ModuleCode); modul.CreateAndSave(viewModel.Config); return(RedirectToAction("Config", "Project", new { Id = viewModel.Project })); }
public IActionResult Edit(YanexXMLModuleViewModel viewModel) { var modul = _modulRegistry.OpenModule <YandexXMLModule>(_context, YandexXMLModule.ModuleCode, viewModel.Id); var result = modul.SaveConfig(viewModel.Config); if (result) { TempData["message"] = $" Config of {modul.Name} has been changed"; } return(View(new YanexXMLModuleViewModel(modul.Id, modul.Configuration) { HttpModules = ProjectModuleRegistry.GetModules <HttpProviderRuntimeConfig, HttpProviderData>(_context, _modulRegistry, modul.Configuration.ProjectModule.Project.Id) })); }