public IActionResult UpdateSettings(UpdateSettingsDto body) { EFCoreContextWrite context = new EFCoreContextWrite(); var settings = context.Settings.Single(x => x.Id == body.Id); settings.ConfigKey = body.ConfigKey; settings.ConfigValues = body.ConfigValues; context.SaveChanges(); Configs.Configs.Init(); return(Ok(new ApiResponse()));; }
/// <summary> /// 增加(主库操作) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="model"></param> /// <returns></returns> public int Add <T>(T model) where T : class { context.Entry(model).State = EntityState.Added; return(context.SaveChanges()); }