Vocabolario

- aggiunto modello
- aggiunta metori recupero DB/REDIS
- aggiunto metodo traduzione lemmi (pag parametri)
This commit is contained in:
Samuele Locatelli
2022-11-03 11:46:09 +01:00
parent 8b91210115
commit 491365e8df
10 changed files with 187 additions and 19 deletions
+46 -2
View File
@@ -354,6 +354,32 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// insert di un record Dossier
/// </summary>
/// <param name="editRec">record dossier da modificare</param>
/// <returns></returns>
public async Task<bool> DossiersInsert(Dossiers newRec)
{
bool fatto = false;
using (var dbCtx = new MoonProContext(_configuration))
{
try
{
dbCtx
.DbSetDossiers
.Add(newRec);
await dbCtx.SaveChangesAsync();
fatto = true;
}
catch (Exception exc)
{
Log.Error($"Eccezione durante DossiersInsert{Environment.NewLine}{exc}");
}
}
return fatto;
}
/// <summary>
/// Effettua salvataggio snapshot parametri (con stored) + svuota eventuale cache redis
/// </summary>
@@ -401,7 +427,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Update ddel campo VALORE di un dossier (che contiene json flux log serializzati)
/// Update del campo VALORE di un dossier (che contiene json flux log serializzati)
/// </summary>
/// <param name="editRec">record dossier da modificare</param>
/// <returns></returns>
@@ -744,7 +770,7 @@ namespace MP.Data.Controllers
}
/// <summary>
/// Recupero Odl CORRENTI
/// Recupero Odl CORRENTI
/// </summary>
/// <returns></returns>
public List<ODLModel> OdlGetCurrent()
@@ -1001,6 +1027,24 @@ namespace MP.Data.Controllers
return dbResult;
}
/// <summary>
/// Elenco Vocabolario (completo)
/// </summary>
/// <returns></returns>
public List<VocabolarioModel> VocabolarioGetAll()
{
List<VocabolarioModel> dbResult = new List<VocabolarioModel>();
using (var dbCtx = new MoonProContext(_configuration))
{
dbResult = dbCtx
.DbSetVocabolario
.AsNoTracking()
.OrderBy(x => x.Lemma)
.ToList();
}
return dbResult;
}
#endregion Public Methods
#region Private Fields