Daten können hinzugefügt

This commit is contained in:
Husky
2020-02-20 21:32:36 +01:00
parent 10ea0783e7
commit 954ffb4bc8
34 changed files with 861 additions and 715 deletions

41
KanSan.Base/UnitOfWork.cs Normal file
View File

@@ -0,0 +1,41 @@
using KanSan.Base.Interfaces;
using KanSan.Base.Models;
using System;
using System.Collections.Generic;
using System.Text;
namespace KanSan.Base
{
public class UnitOfWork : IUnitOfWork
{
private KanSanContext _dbContext;
private BaseRepository<Baustelle> _baustellen;
private BaseRepository<Kunde> _kunden;
public UnitOfWork(KanSanContext dbContext)
{
_dbContext = dbContext;
}
public IRepository<Baustelle> BaustellenRepository
{
get
{
return _baustellen ?? (_baustellen = new BaseRepository<Baustelle>(_dbContext));
}
}
public IRepository<Kunde> KundenRepository
{
get
{
return _kunden ?? (_kunden = new BaseRepository<Kunde>(_dbContext));
}
}
public void Commit()
{
_dbContext.SaveChanges();
}
}
}