Fix null input vari

This commit is contained in:
Samuele E. Locatelli (W11-AI)
2026-03-18 18:50:37 +01:00
parent 58f130e059
commit d2de5f4657
4 changed files with 25 additions and 1 deletions
@@ -23,9 +23,15 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils
public async Task<bool> DeleteAsync(GenClassModel entity)
{
// Add validation for null entity
if (entity == null) return false;
await using var dbCtx = await CreateContextAsync();
dbCtx.DbSetGenClass.Remove(entity);
return await dbCtx.SaveChangesAsync() > 0;
bool done = await dbCtx.SaveChangesAsync() > 0;
return done;
}