Interktion im WPF erweitert
This commit is contained in:
@@ -25,6 +25,11 @@ namespace DaSaSo.EntityFramework.Services
|
||||
return await _nonQueryDataService.Create(entity);
|
||||
}
|
||||
|
||||
public Buildingsite CreateNonAsync(Buildingsite entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<bool> Delete(int id)
|
||||
{
|
||||
return await _nonQueryDataService.Delete(id);
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace DaSaSo.EntityFramework.Services
|
||||
return await _nonQueryDataService.Create(entity);
|
||||
}
|
||||
|
||||
public Client CreateNonAsync(Client entity)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<bool> Delete(int id)
|
||||
{
|
||||
return await _nonQueryDataService.Delete(id);
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace DaSaSo.EntityFramework.Services
|
||||
return await _nonQueryDataService.Create(entity);
|
||||
}
|
||||
|
||||
public T CreateNonAsync(T entity)
|
||||
{
|
||||
return _nonQueryDataService.CreateNonAsync(entity);
|
||||
}
|
||||
|
||||
public async Task<bool> Delete(int id)
|
||||
{
|
||||
return await _nonQueryDataService.Delete(id);
|
||||
@@ -56,6 +61,11 @@ namespace DaSaSo.EntityFramework.Services
|
||||
{
|
||||
return await _nonQueryDataService.Update(id, entity);
|
||||
}
|
||||
|
||||
T IDataService<T>.CreateNonAsync(T entity)
|
||||
{
|
||||
return _nonQueryDataService.CreateNonAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,5 +56,10 @@ namespace DaSaSo.EntityFramework.Services
|
||||
{
|
||||
return await _nonQueryDataService.Update(id, entity);
|
||||
}
|
||||
|
||||
public Project CreateNonAsync(Project entity)
|
||||
{
|
||||
return _nonQueryDataService.CreateNonAsync(entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ namespace DaSaSo.EntityFramework.Services
|
||||
return await _nonQueryDataService.Create(entity);
|
||||
}
|
||||
|
||||
public SewerObject CreateNonAsync(SewerObject entity)
|
||||
{
|
||||
return _nonQueryDataService.CreateNonAsync(entity);
|
||||
}
|
||||
|
||||
public async Task<bool> Delete(int id)
|
||||
{
|
||||
return await _nonQueryDataService.Delete(id);
|
||||
|
||||
Reference in New Issue
Block a user