Ancora update ART

This commit is contained in:
Samuele Locatelli
2026-05-27 14:46:04 +02:00
parent e2e9111860
commit 8580acdb0c
4 changed files with 60 additions and 40 deletions
+4 -4
View File
@@ -656,20 +656,20 @@ namespace MP.Data.Controllers
/// Update record config
/// </summary>
/// <returns></returns>
public bool ConfigUpdate(ConfigModel updRec)
public async Task<bool> ConfigUpdateAsync(ConfigModel updRec)
{
bool fatto = false;
ConfigModel dbResult = new ConfigModel();
using (var dbCtx = new MoonProContext(options))
{
dbResult = dbCtx
dbResult = await dbCtx
.DbSetConfig
.Where(x => x.Chiave == updRec.Chiave)
.FirstOrDefault();
.FirstOrDefaultAsync();
if (dbResult != null)
{
dbResult.Valore = updRec.Valore;
dbCtx.SaveChanges();
await dbCtx.SaveChangesAsync();
fatto = true;
}
}