/// <summary> /// 初始化一个<see cref="EfLog"/>类型的实例 /// </summary> /// <param name="log">日志操作</param> /// <param name="unitOfWork">工作单元</param> /// <param name="category">日志分类</param> /// <param name="config">数据配置</param> public EfLog(ILog log, UnitOfWorkBase unitOfWork, string category, DataConfig config) { _log = log ?? throw new ArgumentNullException(nameof(log)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); _category = category; _config = config; }
public static void RestartUnitOfWork() { if (_unitOfWork != null) { _unitOfWork.Dispose(); } _unitOfWork = new UnitOfWorkBase(ConnectionString); }
/// <summary> /// Determines whether the specified <paramref name="unitOfWork"/> can be committed. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <returns><c>true</c> if the specified unit of work can be committed; otherwise, <c>false</c>.</returns> /// <remarks> /// <para> /// Group 1 (if the <paramref name="unitOfWork"/> is <c>not</c> part of a <see cref="CompositeUnitOfWork"/>) /// <paramref name="unitOfWork"/>.Parent is NULL /// <c>true</c> if the <paramref name="unitOfWork"/> does not belong to a <see cref="CompositeUnitOfWork"/>; otherwise <c>false</c> /// AmbientExists - /// <c>true</c> if an ambient exists within a given scope; otherwise <c>false</c> /// (ie. per-thread <see cref="PerThreadAmbientContextManager"/> or per-request <see cref="PerRequestAmbientContextManager"/>) /// Ambient.IsCommittable /// true if there is only a single active session on the ambient context; otherwise, false /// </para> /// <para> /// Group 2 (if the <paramref name="unitOfWork"/> belongs to a <see cref="CompositeUnitOfWork"/> - ie. has a parent) /// Ambient.UnitOfWork.IsCommitting /// <c>true</c> if the ambient unit of work is currently being committed; otherwise <c>false</c> /// </para> /// </remarks> public virtual Boolean CanCommitUnitOfWork(UnitOfWorkBase unitOfWork) { return (unitOfWork.Parent == null && (AmbientExists && Ambient.Equals(unitOfWork) && Ambient.IsCommittable)) || Ambient.UnitOfWork.Status == TransactionStatus.Active; }
public RepoUsuarios(IUnitOfWork unitOfWork) { if (unitOfWork == null) { throw new ArgumentNullException(nameof(unitOfWork)); } _unitOfWorkSimple = unitOfWork as UnitOfWorkBase; }
internal RepositoryPropertyWrapper(UnitOfWorkBase container) { if (container == null) { throw new NullReferenceException("Не указан контейнер UnitOfWork."); } _container = container; }
public void CreateContact() { int id = 0; using (IDataContextAsync db = new DBTopAtlantaContext()) using (IUnitOfWorkAsync unitOfWork = new UnitOfWorkBase(db)) { IContactService contactService = new ContactService(unitOfWork.RepositoryAsync<Contact>()); var contact = new Contact { FirstName = "Mike", LastName = "Smyth", Gender = "Male", CreateDate = DateTime.Now, CreatedBy = "test", }; contactService.Insert(contact); id = unitOfWork.SaveChanges(); } //Select using (IDataContextAsync db = new DBTopAtlantaContext()) using (IUnitOfWorkAsync unitOfWork = new UnitOfWorkBase(db)) { IContactService contactService = new ContactService(unitOfWork.RepositoryAsync<Contact>()); var contact = contactService.GetContactByName("Mike", "Smyth").First(); id = contact.ContactId; Assert.IsNotNull(contact); } //Update using (IDataContextAsync db = new DBTopAtlantaContext()) using (IUnitOfWorkAsync unitOfWork = new UnitOfWorkBase(db)) { IContactService contactService = new ContactService(unitOfWork.RepositoryAsync<Contact>()); var contact = contactService.Find(id); contact.Birthday = DateTime.Parse("10/01/1971"); contactService.Update(contact); unitOfWork.SaveChanges(); } //Check and Delete using (IDataContextAsync db = new DBTopAtlantaContext()) using (IUnitOfWorkAsync unitOfWork = new UnitOfWorkBase(db)) { IContactService contactService = new ContactService(unitOfWork.RepositoryAsync<Contact>()); var contact = contactService.Find(id); Assert.AreEqual(DateTime.Compare(DateTime.Parse(contact.Birthday.ToString()), DateTime.Parse("10/01/1971")),0); contactService.Delete(contact); unitOfWork.SaveChanges(); } }
public static UnitOfWorkBase GetUnitOfWork() { if (_unitOfWork != null) { return(_unitOfWork); } _unitOfWork = new UnitOfWorkBase(ConnectionString); _unitOfWork.Configuration.ValidateOnSaveEnabled = false; return(_unitOfWork); }
/// <summary> /// Initializes a new instance of the <see cref="EfUnitOfWork"/> class. /// </summary> /// <param name="ambientContextManager">The transaction manager.</param> /// <param name="dbContextContainer">The context container.</param> /// <param name="parent">The parent.</param> /// <remarks></remarks> protected internal EfUnitOfWork(AmbientContextManagerBase ambientContextManager, IDbContextContainer dbContextContainer, UnitOfWorkBase parent) : base(ambientContextManager, parent) { if (dbContextContainer == null) { throw new ArgumentNullException("dbContextContainer"); } _DbContextContianer = dbContextContainer; }
public void OpenTransactionMustThrowObjectDisposedExceptionWhenSessionIsClose() { //arrange InitialiseNHibernate(); var uow = UnitOfWorkFactory.CreateWithoutRoot(); UnitOfWorkBase uowBaseClass = (UnitOfWorkBase)uow; uowBaseClass.OpenTransaction(); uow.Session.Close(); //act, assert Assert.Throws(typeof(ObjectDisposedException), uowBaseClass.OpenTransaction, "Session is closed!"); }
public void FindContactServiceById() { using (IDataContextAsync fakeDbContext = new UnitTestFakeDbContext()) using (IUnitOfWorkAsync unitOfWork = new UnitOfWorkBase(fakeDbContext)) { IContactService contactService = new ContactService(unitOfWork.RepositoryAsync<Contact>()); contactService.Insert(new Contact { ContactId = 1, ObjectState = ObjectState.Added }); unitOfWork.SaveChanges(); var contact = contactService.Find(1); Assert.IsNotNull(contact); Assert.AreEqual(1, contact.ContactId); } }
public void FindContactById() { using (IDataContextAsync fakeDbContext = new UnitTestFakeDbContext()) using (IUnitOfWork unitOfWork = new UnitOfWorkBase(fakeDbContext)) { unitOfWork.Repository<Contact>().Insert(new Contact { ContactId = 1, ObjectState = ObjectState.Added }); unitOfWork.Repository<Contact>().Insert(new Contact { ContactId = 2, ObjectState = ObjectState.Added }); unitOfWork.Repository<Contact>().Insert(new Contact { ContactId = 3, ObjectState = ObjectState.Added }); unitOfWork.SaveChanges(); var contact = unitOfWork.Repository<Contact>().Find(2); Assert.IsNotNull(contact); Assert.AreEqual(2, contact.ContactId); } }
public void CanGetCorrectNestedCurrentScope() { using (var level1 = new TestUnitOfWork()) { Assert.AreEqual(level1, UnitOfWorkBase.CurrentScope()); using (var level2 = new TestUnitOfWork()) { Assert.AreEqual(level2, UnitOfWorkBase.CurrentScope()); using (var level3 = new TestUnitOfWork()) { Assert.AreEqual(level3, UnitOfWorkBase.CurrentScope()); } Assert.AreEqual(level2, UnitOfWorkBase.CurrentScope()); } Assert.AreEqual(level1, UnitOfWorkBase.CurrentScope()); } }
public void DeleteContactById() { using (IDataContextAsync fakeDbContext = new UnitTestFakeDbContext()) using (IUnitOfWork unitOfWork = new UnitOfWorkBase(fakeDbContext)) { unitOfWork.Repository<Contact>().Insert(new Contact { ContactId = 1, ObjectState = ObjectState.Added }); unitOfWork.SaveChanges(); unitOfWork.Repository<Contact>().Delete(1); unitOfWork.SaveChanges(); var contact = unitOfWork.Repository<Contact>().Find(1); Assert.IsNull(contact); } }
private SaveInfo RegisterUnitOfWork(EumDBWay dbWay, string dbName, string typeInfo) { string setDataBaseConnect = DataBaseHelper.GetConnectionStrings(dbWay, dbName, typeInfo); IList <IUnitOfWork> unitofworks = IoC.Resolve <IContext>().Local.UnitOfWorks ?? new List <IUnitOfWork>(); IUnitOfWork findwork = unitofworks.FirstOrDefault(it => it.GetKey() == setDataBaseConnect); SaveInfo info = new SaveInfo { Sequence = findwork?.GetSequence() + 1 ?? 1 }; if (findwork != null) { findwork.Add(info); } else { findwork = new UnitOfWorkBase(setDataBaseConnect); findwork.Add(info); unitofworks.Add(findwork); } return(info); }
public void Setup() { var builder = new DbContextOptionsBuilder <PaymentContext>(); builder.UseInMemoryDatabase("Payments"); var options = builder.Options; var expensivePaymentGateway = new Mock <IExpensivePaymentGateway>(); var cheapPaymentGateway = new Mock <ICheapPaymentGateway>(); var premiumPaymentService = new Mock <IPremiumPaymentService>(); var controllerLogger = new Mock <ILogger <PaymentController> >(); var paymentServiceLogger = new Mock <ILogger <PaymentService> >(); var paymentStatusServiceLogger = new Mock <ILogger <PaymentStatusService> >(); var paymentContext = new PaymentContext(options); var unitOfwork = new UnitOfWorkBase <PaymentContext>(paymentContext); var paymentStatusService = new PaymentStatusService(unitOfwork, paymentStatusServiceLogger.Object); var paymentService = new PaymentService(paymentStatusService, unitOfwork, paymentServiceLogger.Object, expensivePaymentGateway.Object, cheapPaymentGateway.Object, premiumPaymentService.Object); PaymentController = new PaymentController(paymentService, controllerLogger.Object); }
public ServiceBase(DbContext _db) //dependency inj. { db = _db; repository = new Repository <TEntity>(db); //somut class larını yaptığımız için newleyebilirz unitOfWork = new UnitOfWork(db); }
/// <summary> /// 初始化Ef日志提供器 /// </summary> /// <param name="log">日志操作</param> /// <param name="unitOfWork">工作单元</param> public EfLogProvider(ILog log, UnitOfWorkBase unitOfWork) { _log = log ?? throw new ArgumentNullException(nameof(log)); _unitOfWork = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork)); }
public KullaniciDal() { _context = new StokContext(); _uow = new UnitOfWorkBase(_context); }
/// <summary> /// 初始化一个<see cref="DbContextWrapper{TEntity,TKey}"/>类型的实例 /// </summary> /// <param name="unitOfWork">工作单元</param> public DbContextWrapper(IUnitOfWork unitOfWork) { UnitOfWork = (UnitOfWorkBase)unitOfWork; }
public StokHareketRaporuDal() { _context = new StokContext(); _uow = new UnitOfWorkBase(_context); }
public EfCoreRepositoryContext(UnitOfWorkBase unitOfWork) { ConnectionString = unitOfWork.ConnectionString; _unitOfWork = unitOfWork; _context = _unitOfWork; }
public BlogRepositoryImpl(UnitOfWorkBase <AppDbContext> uow) : base(uow) { }
public DatabaseInitilize() { context = new StokContext(); _uow = new UnitOfWorkBase(context); // Procedure Initilize #region Kullanici Procedure string insertKullaniciProducedure = @"CREATE PROCEDURE [dbo].[Insert_Kullanici] @KullaniciAdi NVARCHAR(25), @Isim NVARCHAR(20), @Soyisim NVARCHAR(20), @Sifre NVARCHAR(35), @AktifMi BIT AS BEGIN BEGIN TRANSACTION [insert_tran]; BEGIN TRY INSERT INTO dbo.Kullanicilar ( KullaniciAdi, Isim, Soyisim, Sifre, AktifMi ) VALUES (@KullaniciAdi, @Isim, @Soyisim, @Sifre, @AktifMi); COMMIT TRANSACTION [insert_tran]; RETURN 1; END TRY BEGIN CATCH ROLLBACK TRANSACTION [insert_tran]; RETURN -1; END CATCH; END;"; _uow.GenericRepository <KullaniciDto>().SqlQuery(insertKullaniciProducedure); #endregion #region Depo Procedure string InsertDepoProcedure = @"CREATE PROCEDURE [dbo].[Insert_Depo] @DepoKodu NVARCHAR(15), @DepoAdi NVARCHAR(25), @AktifMi BIT AS BEGIN BEGIN TRANSACTION [insert_tran]; BEGIN TRY INSERT INTO dbo.Depolar ( DepoKodu, DepoAdi, AktifMi ) VALUES ( @DepoKodu, -- DepoKodu - nvarchar(15) @DepoAdi, -- DepoAdi - nvarchar(max) @AktifMi -- AktifMi - bit ); COMMIT TRANSACTION [insert_tran]; RETURN 1; END TRY BEGIN CATCH ROLLBACK TRANSACTION [insert_tran]; RETURN -1; END CATCH; END;"; _uow.GenericRepository <DepoDto>().SqlQuery(InsertDepoProcedure); #endregion #region Stok Hareketleri Procedure string insertStokHareketleriProcedure = @"CREATE PROCEDURE [dbo].[Insert_StokHareketleri] @Fisno NVARCHAR(15), @Miktar INT, @HareketDurumId INT, @StokKartId INT, @KayitTarihi DATETIME, @KullaniciId INT, @AktifMi BIT AS BEGIN BEGIN TRANSACTION [insert_tran]; BEGIN TRY INSERT INTO dbo.Stok_Hareketleri ( FisNo, Miktar, HareketDurumId, StokKartId, KayitTarihi, KullaniciId, AktifMi ) VALUES ( @Fisno, @Miktar, @HareketDurumId, @StokKartId, @KayitTarihi, @KullaniciId, @AktifMi ) COMMIT TRANSACTION [insert_tran]; RETURN 1; END TRY BEGIN CATCH ROLLBACK TRANSACTION [insert_tran]; RETURN -1; END CATCH; END;"; _uow.GenericRepository <StokHareketleriDto>().SqlQuery(insertStokHareketleriProcedure); string queryForeignKey = @"ALTER TABLE Stok_Hareketleri ADD FOREIGN KEY(StokKartId) REFERENCES Stok_Kartlari(StokKartId); "; _uow.GenericRepository <StokHareketleriDto>().SqlQuery(queryForeignKey); #endregion #region Stok Kartları Procedure string insertStokKartlariProcedure = @"CREATE PROCEDURE [dbo].[Insert_StokKartlari] @StokKodu NVARCHAR(15), @StokAdi NVARCHAR(50), @Kdv INT, @Fiyat DECIMAL(18,2), @Aciklama NVARCHAR(MAX), @Resim VARBINARY(MAX), @DepoId INT, @KayitTarihi DATETIME, @KullaniciId INT, @Aktif BIT AS BEGIN BEGIN TRANSACTION [insert_tran]; BEGIN TRY INSERT INTO dbo.Stok_Kartlari ( StokKodu, StokAdi, Kdv, Fiyat, Aciklama, Resim, DepoId, KayitTarihi, KullaniciId, AktifMi ) VALUES ( @StokKodu, -- StokKodu - nvarchar(15) @StokAdi, -- StokAdi - nvarchar(50) @Kdv, -- Kdv - int @Fiyat, -- Fiyat - decimal(18, 2) @Aciklama, -- Aciklama - nvarchar(max) @Resim, -- Resim - varbinary(max) @DepoId, -- DepoId - int @KayitTarihi, -- KayitTarihi - datetime @KullaniciId, -- KullaniciId - int @Aktif -- AktifMi - bit ) COMMIT TRANSACTION [insert_tran]; RETURN 1; END TRY BEGIN CATCH ROLLBACK TRANSACTION [insert_tran]; RETURN -1; END CATCH; END;"; _uow.GenericRepository <StokKartiDto>().SqlQuery(insertStokKartlariProcedure); #endregion #region Stok Hareket Tipi Procedure string insertStokHareketTipiProcedure = @"CREATE PROCEDURE [dbo].[Insert_Stok_Hareket_Tipi] @StokHareketTipi NVARCHAR(10), @AktifMi Bit AS BEGIN BEGIN TRANSACTION [insert_tran]; BEGIN TRY INSERT INTO dbo.Stok_Hareket_Tipi ( HareketTipi, AktifMi ) VALUES ( @StokHareketTipi, -- HareketTipi - nvarchar(10) @AktifMi -- AktifMi - bit ) COMMIT TRANSACTION [insert_tran]; RETURN 1; END TRY BEGIN CATCH ROLLBACK TRANSACTION [insert_tran]; RETURN -1; END CATCH; END;"; _uow.GenericRepository <StokHareketTipiDto>().SqlQuery(insertStokHareketTipiProcedure); #endregion #region Kullanıcı Olustur PasswordHash passwordHash = new PasswordHash(); KullaniciDto kullanici = new KullaniciDto() { Isim = "Yusuf", Soyisim = "Güvençli", KullaniciAdi = "YusufGuvencli", Sifre = passwordHash.Hash("123456"), AktifMi = true }; KullaniciDal kullaniciDLL = new KullaniciDal(); kullaniciDLL.KullaniciEkle(kullanici); #endregion #region Stok Hareket Tipi Olustur StokHareketTipiDto stokHareketTipi; StokHareketTipiDal stokHareketDal; string[] hareketler = new string[] { "Giriş", "Çıkış" }; for (int i = 0; i < hareketler.Length; i++) { stokHareketTipi = new StokHareketTipiDto(); stokHareketTipi.HareketTipi = hareketler[i]; stokHareketTipi.AktifMi = true; stokHareketDal = new StokHareketTipiDal(); stokHareketDal.StokHareketTipiEkle(stokHareketTipi); } #endregion #region Depo Olustur DepoDto depoDto = new DepoDto() { DepoAdi = "Test Deposu", DepoKodu = "00001", AktifMi = true }; DepoDal depoDal = new DepoDal(); depoDal.DepoEkle(depoDto); #endregion #region Stok Hareketleri View string stokHareketView = @"CREATE VIEW [dbo].[vw_StokHareketleri] AS SELECT H.HareketId, H.FisNo, H.Miktar, tip.HareketDurumId, tip.HareketTipi, K.StokKartId, K.StokKodu, K.StokAdi, H.KayitTarihi FROM dbo.Stok_Hareketleri AS H INNER JOIN dbo.Stok_Kartlari AS K ON K.StokKartId = H.StokKartId INNER JOIN dbo.Stok_Hareket_Tipi AS tip ON tip.HareketDurumId = H.HareketDurumId WHERE (H.AktifMi = 1)"; _uow.GenericRepository <StokHareketleriDto>().SqlQuery(stokHareketView); #endregion #region Stok Hareket Raporu View string stokHareketRaporu = @"CREATE VIEW [dbo].[vw_StokHareketRaporu] AS SELECT H.FisNo, H.Miktar, H.KayitTarihi AS HareketTarihi, tip.HareketTipi, K.StokKodu, K.StokAdi, K.Aciklama, K.KayitTarihi AS StokKayitTarihi FROM dbo.Stok_Hareketleri AS H INNER JOIN dbo.Stok_Hareket_Tipi AS tip ON tip.HareketDurumId = H.HareketDurumId INNER JOIN dbo.Stok_Kartlari AS K ON K.StokKartId = H.StokKartId"; _uow.GenericRepository <StokHareketleriRaporDto>().SqlQuery(stokHareketRaporu); #endregion #region string stokDurumRaporu = @"CREATE VIEW [dbo].[vw_StokDurumRaporu] AS WITH cte AS (SELECT StokKartId, (SELECT SUM(Miktar) AS Expr1 FROM dbo.Stok_Hareketleri AS H1 WHERE (HareketDurumId = 1) AND (StokKartId = H.StokKartId) AND (AktifMi = 1)) AS ToplamGiris, (SELECT SUM(Miktar) AS Expr1 FROM dbo.Stok_Hareketleri AS H1 WHERE (HareketDurumId = 2) AND (StokKartId = H.StokKartId) AND (AktifMi = 1)) AS ToplamCikis FROM dbo.Stok_Hareketleri AS H GROUP BY StokKartId) SELECT K.StokAdi, K.StokKodu, D.DepoAdi, D.DepoKodu, ISNULL(cte_1.ToplamGiris, 0) AS MevcutStok, ISNULL(cte_1.ToplamCikis, 0) AS CikanStok FROM cte AS cte_1 INNER JOIN dbo.Stok_Kartlari AS K ON K.StokKartId = cte_1.StokKartId INNER JOIN dbo.Depolar AS D ON D.DepoId = K.DepoId"; _uow.GenericRepository <StokHareketView>().SqlQuery(stokDurumRaporu); #endregion }
/// <summary> /// Determines whether the specified <paramref name="unitOfWork"/> can be disposed. /// </summary> /// <param name="unitOfWork">The unit of work.</param> /// <returns> /// <c>true</c> if no <see cref="AmbientExists"/>; otherwise: /// <c>true</c> if the <see cref="AmbientUnitOfWorkDecorator.IsDisposable"/> and <paramref name="unitOfWork.Parent"/> is null; otherwise <c>false</c> /// </returns> /// <remarks></remarks> public virtual Boolean CanDisposeUnitOfWork(UnitOfWorkBase unitOfWork) { if (AmbientExists) { // Save the current disposable state of the ambient unit of work locally since further execution may affect it. var ambientIsDisposable = Ambient.IsDisposable; if (Ambient.Equals(unitOfWork)) { if (ambientIsDisposable) { AmbientUnitsOfWork.Pop(); } else { Ambient.Decrement(); } } if ((unitOfWork.Status == TransactionStatus.Committed || unitOfWork.Status == TransactionStatus.Aborted) || (ambientIsDisposable && unitOfWork.Parent == null)) { return true; } return false; } return true; }
/// <summary> /// Adds the unit of work to the stack; thus making it the new ambient context. /// </summary> /// <param name="unitOfWork">The unit of work.</param> public virtual void AddUnitOfWork(UnitOfWorkBase unitOfWork) { AmbientUnitsOfWork.Push(new AmbientUnitOfWorkDecorator(unitOfWork)); }
public virtual void Execute() { Execute(UnitOfWorkBase.CurrentScope()); }
/// <summary> /// 初始化查询存储器 /// </summary> /// <param name="unitOfWork">工作单元</param> protected EfCoreStoreBase(IUnitOfWork unitOfWork) { _unitOfWorkBase = (UnitOfWorkBase)unitOfWork; traceId = _unitOfWorkBase.TraceId; }
public void InsertRangeOfContacts() { using (IDataContextAsync fakeDbContext = new UnitTestFakeDbContext()) using (IUnitOfWork unitOfWork = new UnitOfWorkBase(fakeDbContext)) { var newContacts = new[] { new Contact {ContactId = 1, ObjectState = ObjectState.Added}, new Contact {ContactId = 2, ObjectState = ObjectState.Added}, new Contact {ContactId = 3, ObjectState = ObjectState.Added} }; unitOfWork.Repository<Contact>().InsertRange(newContacts); var savedContacts = unitOfWork.Repository<Contact>().Query().Select(); Assert.AreEqual(savedContacts.Count(), newContacts.Length); } }
public AuthorInviteRepositoryImpl(UnitOfWorkBase <AppDbContext> uow) : base(uow) { }
public void UpdateContact() { using (IDataContextAsync fakeDbContext = new UnitTestFakeDbContext()) using (IUnitOfWork unitOfWork = new UnitOfWorkBase(fakeDbContext)) { unitOfWork.Repository<Contact>().Insert(new Contact { ContactId = 2, FirstName = "Steve", ObjectState = ObjectState.Added }); unitOfWork.SaveChanges(); var contact = unitOfWork.Repository<Contact>().Find(2); Assert.AreEqual(contact.FirstName, "Steve", "Assert we are able to find the inserted Contact."); contact.FirstName = "Mike"; contact.ObjectState = ObjectState.Modified; unitOfWork.Repository<Contact>().Update(contact); unitOfWork.SaveChanges(); Assert.AreEqual(contact.FirstName, "Mike", "Assert that our changes were saved."); } }
public HomeController(RoleManager <IdentityRole> roleManager, UserManager <BaseUser> userManager, ApplicationDbContext dbcontext) { _unitOfWork = new UnitOfWorkBase(dbcontext, userManager, roleManager); }
public RepositoryBase(UnitOfWorkBase <TContext> uow) { UnitOfWork = uow; }
public ServiceBase(DbContext _db) { db = _db; repository = new Repository <TEntity>(db); unitOfWork = new UnitOfWork(db); }
public DepoDal() { _context = new StokContext(); _uow = new UnitOfWorkBase(_context); }