/// <summary> /// Gönderilen depo entity'sini veritabanına ekler. /// Hata alması durumunda -1 döner. /// </summary> /// <param name="depo"></param> /// <returns></returns> public int DepoEkle(DepoDto depo) { int result = -1; DynamicTryCatch.TryCatchLogla(() => { result = _uow.GenericRepository <DepoDto>().InsertWithProcedure("Exec Insert_Depo @DepoKodu, @DepoAdi, @AktifMi", new SqlParameter("@DepoKodu", SqlDbType.VarChar) { Value = depo.DepoKodu }, new SqlParameter("@DepoAdi", SqlDbType.VarChar) { Value = depo.DepoAdi }, new SqlParameter("@AktifMi", SqlDbType.Bit) { Value = depo.AktifMi }); _uow.Dispose(); } , MethodBase.GetCurrentMethod().Name); return(result); }
public static void RestartUnitOfWork() { if (_unitOfWork != null) { _unitOfWork.Dispose(); } _unitOfWork = new UnitOfWorkBase(ConnectionString); }
protected void Dispose(bool disposing) { if (!disposing) { return; } if (_unitOfWorkSimple == null) { return; } _unitOfWorkSimple.Dispose(); }
protected virtual void Dispose(bool disposing) { if (!this.disposed && disposing) //service.dispose u çağırdıysam demek { if (unitOfWork != null) { unitOfWork.Dispose(); } if (repository != null) { repository.Dispose(); } if (db != null) { db.Dispose(); } } disposed = true; }
protected virtual void Dispose(bool disposing) { if (!this.disposed && disposing) { if (unitOfWork != null) { unitOfWork.Dispose(); } if (repository != null) { repository.Dispose(); } if (db != null) { db.Dispose(); } } this.disposed = true; }
protected override void Dispose(bool disposing) { base.Dispose(disposing); _unitOfWork.Dispose(); }