예제 #1
0
 public IActionResult AddConfiguration(ConfigurationViewModel model)
 {
     try
     {
         var newConfig = new Configuration()
         {
             ConfigurationName = model.ConfigurationName,
             ConfigType        = model.ConfigType,
             Config            = JsonSerializer.Serialize(model.Config)
         };
         _service.AddConfig(newConfig);
         return(RedirectToAction("Index", new { messageType = 1, message = $"{newConfig.ConfigurationName}.{newConfig.ConfigType} saved successfully to database." }));
     }
     catch (Exception)
     {
         return(RedirectToAction("Index", new { messageType = 2, message = $"Something went wrong while inserting into the DB" }));
     }
 }
예제 #2
0
 public BasicResponse <ConfigInfo> AddConfig(ConfigAddRequest configrequest)
 {
     return(_configService.AddConfig(configrequest));
 }