Interktion im WPF erweitert

This commit is contained in:
HuskyTeufel
2021-09-22 16:26:56 +02:00
parent efa52c117c
commit e23f898f14
48 changed files with 1946 additions and 88 deletions

View File

@@ -27,6 +27,16 @@ namespace DaSaSo.EntityFramework.Services.Common
}
}
public T CreateNonAsync(T entity)
{
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())
{
EntityEntry<T> createdEntity = context.Set<T>().Add(entity);
context.SaveChanges();
return createdEntity.Entity;
}
}
public async Task<bool> Delete(int id)
{
using (DaSaSoDbContext context = _contextFactory.CreateDbContext())