Projekte können erstellt und geladen werden

This commit is contained in:
2023-03-30 20:56:21 +02:00
parent e5214e44c3
commit 70bba66df3
32 changed files with 1050 additions and 93 deletions

View File

@@ -36,7 +36,8 @@ namespace SewerStammGen.EntityFramework.Services.Common
public async Task<bool> Delete(int id)
{
using SewerStammGenDbContext context = _contextFactory.CreateDbContext();
T entity = await context.Set<T>().FirstOrDefaultAsync((e) => e.Id == id);
T? entity = await context.Set<T>().FirstOrDefaultAsync((e) => e.Id == id);
if (entity == null) return false;
context.Set<T>().Remove(entity);
await context.SaveChangesAsync();
return true;