예제 #1
0
        public async Task Cleanup()
        {
            CoreUnitOfWork.ClearTracker();
            Wallet wallet = await CoreUnitOfWork.WalletRepository.GetFirstOrDefaultWithIncludes(
                wallet => wallet.JMBG == "1203977780011",
                wallet => wallet.Transactions
                );

            if (wallet != null)
            {
                await CoreUnitOfWork.WalletRepository.Delete(wallet);

                await CoreUnitOfWork.SaveChangesAsync();
            }

            Wallet wallet2 = await CoreUnitOfWork.WalletRepository.GetFirstOrDefaultWithIncludes(
                wallet => wallet.JMBG == "1203008780011",
                wallet => wallet.Transactions
                );

            if (wallet2 != null)
            {
                await CoreUnitOfWork.WalletRepository.Delete(wallet);

                await CoreUnitOfWork.SaveChangesAsync();
            }
            await DbContext.DisposeAsync();

            DbContext = null;
        }
        public async Task Cleanup()
        {
            CoreUnitOfWork.ClearTracker();
            Wallet wallet1 = await CoreUnitOfWork.WalletRepository.GetFirstOrDefaultWithIncludes(
                wallet => wallet.JMBG == "2904992785075",
                wallet => wallet.Transactions
                );

            if (wallet1 != null)
            {
                await CoreUnitOfWork.WalletRepository.Delete(wallet1);

                await CoreUnitOfWork.SaveChangesAsync();
            }
            Wallet wallet2 = await CoreUnitOfWork.WalletRepository.GetFirstOrDefaultWithIncludes(
                wallet => wallet.JMBG == "2904990785034",
                wallet => wallet.Transactions
                );

            if (wallet2 != null)
            {
                await CoreUnitOfWork.WalletRepository.Delete(wallet2);

                await CoreUnitOfWork.SaveChangesAsync();
            }
            await DbContext.DisposeAsync();

            DbContext = null;
        }