Fix delete dossier sistemato...
This commit is contained in:
@@ -735,29 +735,18 @@ namespace MP.Data.Controllers
|
||||
/// </summary>
|
||||
/// <param name="currRec">record dossier da eliminare</param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> DossiersDeleteRecord(DossierModel currRec)
|
||||
public async Task<bool> DossiersDeleteRecordAsync(DossierModel currRec)
|
||||
{
|
||||
bool answ = false;
|
||||
using (var dbCtx = new MoonPro_FluxContext(_configuration))
|
||||
{
|
||||
try
|
||||
{
|
||||
var currVal = dbCtx
|
||||
using var dbCtx = new MoonPro_FluxContext(_configuration);
|
||||
var currVal = await dbCtx
|
||||
.DbSetDossiers
|
||||
.Where(x => x.IdxDossier == currRec.IdxDossier)
|
||||
.FirstOrDefault();
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Remove(currVal);
|
||||
await dbCtx.SaveChangesAsync();
|
||||
answ = true;
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Log.Error($"Eccezione durante DossiersDeleteRecord{Environment.NewLine}{exc}");
|
||||
}
|
||||
}
|
||||
return answ;
|
||||
.FirstOrDefaultAsync();
|
||||
dbCtx
|
||||
.DbSetDossiers
|
||||
.Remove(currVal);
|
||||
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user