zzz projects Entity Framework Core EF Core
Home Articles Knowledge Base Online Examples
  • Home
  • Articles
  • Knowledge Base
  • Online Examples

Entity Framework Core - Knowledge Base (KB)

18 results in tag: transactions

Is transaction scope available in Entity framework 6.0

Entity framework 6.0 articles shows only "UseTransaction" and "BeginTransaction". Is transaction scope still available in Entity framework 6.0. If yes, how to use it and which dll to include?
entity-framework entity-framework-6 transactions
asked by Sumesh Kuttan

Database.BeginTransaction vs Transactions.TransactionScope

What is the difference between ...System.Transactions.TransactionScope... and EF6's ...Database.BeginTransaction...?...Could someone give a small example or just explain which one to use when with a clear difference?...P.S: In my project, I'm using EF6. I...
c# entity-framework entity-framework-6 transactions transactionscope
asked by Flair

Entity Framework 6 transaction rollback

With EF6 you have a new transaction which can be used like:...using (var context = new PostEntityContainer()) { using (var dbcxtransaction = context.Database.BeginTransaction()) { try { ...
c# entity-framework entity-framework-6 sql-server transactions
asked by The Cookies Dog

Entity Framework: how to find transaction isolation level in SQL Profiler?

BeginTransaction... method is used to manage transactions in Entity Framework 6. It allows to set isolation level for transaction as you may see in code below (just a sample):...using (var context = new DataContext()) { using (var transaction = contex...
entity-framework entity-framework-6 sql-server sql-server-2012 transactions
asked by Ilya Chumakov

Nested Transaction Behavior in EF6

I'm currently using TransactionScope to manage transactions in my data layer, but I've been running into issues with nested transactions and async whereby the connection seems to close during the nested transaction or the transaction is promoted to MSDTC....
c# entity-framework entity-framework-6 transactions
asked by Joel Mitchell

Use the same transaction in different methods with Entity Framework Core

EDIT (02/03/2018) :... Since Entity Framework Core 2.1, EF Core implements transactions, cross-context transactions, ambient transactions and transactions scopes so this question is now out of date. ...This is the official documentation about the transact...
asp.net-core-1.0 c# entity-framework-core sql-server-2014-express transactions
asked by AdrienTorris

Entity Framework 6 Handle Transaction At Database Level

I have a stored procedure that uses transactions at a database level (the transactions are handled within the stored procedure itself). This means I need to tell Entity Framework not to handle transactions....Now using database first model I can import th...
c# entity-framework entity-framework-6 sql-server transactions
asked by Tom Maher

How to unit-test transactions in Entity Framework Core?

I have a method that does some work in a transaction:...public async Task<int> AddAsync(Item item) { int result; using (var transaction = await _context.Database.BeginTransactionAsync()) { _context.Add(item); // Save the item...
entity-framework-core in-memory-database sqlite transactions unit-testing
asked by tomRedox

Entity Framework Core and DocumentDB Transaction

is there any way to execute an all-or-nothing transaction with both systems included? E.g....using(transaction) { DbContext.SaveChanges(); DocumentClient.DoStuff(); transaction.Commit(); } ...EF Core does not seem to support Transaction Scope....
azure-cosmosdb entity-framework-core transactions
asked by mbue

Does a transaction Rollback() have any chance to throw an exception?

Question related to managing trasactions with EF Core:...Does an ...IDbContextTransaction.Rollback()... have any chance to return an exception, so that it could ever make sense to place it inside a try block?...i.e.... try { //... i...
asp.net-core c# entity-framework entity-framework-core transactions
asked by eduherminio

UnitofWork [aspnetboilerplate] Transaction Management

I am currently working on implementing aspnetboilerplate's transaction management...Below is the method I am using to insert a order and products associated with the order...public class OrderController { IOrderAppService _orderAppService; public ...
aspnetboilerplate entity-framework entity-framework-6 transactions
asked by Vijayakumar Natarajan

How to create a DBContext as part of an existing transaction in Entity Framework Core

I have product that already uses ADO.Net to access SQL Server and I'm using Entity Framework Core for some new functionality. The problem I'm having is I have some operations that must be done in a single transaction and the first few actions are implemen...
ado.net c# entity-framework-core transactions
asked by Mog0

Transaction Deadlocks on SQL Server Insert with EF Core

I'm trying to do a large number of individual inserts containing a large amount of data quickly using Entity Framework Core. I'm inserting data into several related tables and occasionally get a ...SqlException... with the following message;...Transaction...
deadlock entity-framework-core sql-insert sql-server transactions
asked by Muhammad Rehan Saeed

Select and update by one transaction

I have some product to sale and I want to check existing of product in store. I use Entity Framework and SQL server. I want some think like this....IF ((SELECT TOP 1 Amount FROM tblProduct WHERE Id =1)>0) UPDATE tblProduct SET count = count -1 WHERE Id = ...
c# entity-framework entity-framework-6 sql-server transactions
asked by Amirhossein Yari

Enforcing business rules in entity framework core

Let's assume that I have a controller's action which does the following:...checks if there is a calendar slot at a particular time...checks if there are no appointments already booked that overlap with that slot...if both conditions are satisfied it creat...
.net .net-core c# entity-framework-core transactions
asked by Shoe

What's the point of multiple SaveChanges inside an entity-framework-core transaction?

I'm using EF for my .net-core application and I'm wondering what is the difference between calling ...SaveChanges... multiple times during a transaction and only calling it once before committing. To better illustrate my question, I will provide some pseu...
.net-core c# entity-framework-core transactions
asked by Hristo Stoichev

Transactions in unit of work pattern for EF core

I am using unit of work pattern for EF core database first approach in my application. I have also implemented database transactions in unit of work class. For e.g....public class UnitOfWork : IUnitOfWork { private myDBContext _dBContext; public I...
c# entity-framework-core transactions
asked by NagendraTheCoder

Make API call and database operations atomic

I want to do the following:...Begin a transaction...insert data to a database...After the insert, submits data to an API endpoint with the newly added rows' primary key...Then commit the transaction...If the insert fails, nothing will be done and everythi...
atomic c# entity-framework entity-framework-6 transactions
asked by morbidCode

Page 1 of 1
  • 1

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...

Related

  • EF Extensions Online Benchmark
  • WIN an EF Extensions license
  • EF6 BatchSaveChanges for only $79
Get monthly updates by subscribing to our newsletter!
SUBSCRIBE!