Fix null input vari
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user