 <p>Yes, it's possible to do and it's very useful when you want to <strong>insert a entity to database</strong> and use <strong>the auto-generated id for the next insert or update</strong> </p> <pre><code>using (var context = new DbContext()) { using (var transaction = context.Database.BeginTransaction()) { var item = new Item(); context.Items.Insert(item); context.SaveChanges(); // temporary insert to db to get back the auto-generated id // do some other things var otherItem = context.OtherItems.First(); // use the inserted id otherItem.Message = $"You just insert item with id = {item.Id} to database"; transaction.Commit(); } } </code></pre> <p>Because your question also asked about a working pattern, here's my working code (with use of FluentApi, DbContext &amp; Transaction). I was having the same issue as you :). Hope it helps you</p> <pre><code>public class FluentUnitOfWork : IDisposable { private DbContext Context { get; } private DbContextTransaction Transaction { get; set; } public FluentUnitOfWork(DbContext context) { Context = context; } public FluentUnitOfWork BeginTransaction() { Transaction = Context.Database.BeginTransaction(); return this; } public FluentUnitOfWork DoInsert&lt;TEntity&gt;(TEntity entity) where TEntity : class { Context.Set&lt;TEntity&gt;().Add(entity); return this; } public FluentUnitOfWork DoInsert&lt;TEntity&gt;(TEntity entity, out TEntity inserted) where TEntity : class { inserted = Context.Set&lt;TEntity&gt;().Add(entity); return this; } public FluentUnitOfWork DoUpdate&lt;TEntity&gt;(TEntity entity) where TEntity : class { Context.Entry(entity).State = EntityState.Modified; return this; } public FluentUnitOfWork SaveAndContinue() { try { Context.SaveChanges(); } catch (DbEntityValidationException dbEx) { // add your exception handling code here } return this; } public bool EndTransaction() { try { Context.SaveChanges(); Transaction.Commit(); } catch (DbEntityValidationException dbEx) { // add your exception handling code here } return true; } public void RollBack() { Transaction.Rollback(); Dispose(); } public void Dispose() { Transaction?.Dispose(); Context?.Dispose(); } } </code></pre> <p>Sample usage:</p> <pre><code>var status = BeginTransaction() // First Part .DoInsert(entity1) .DoInsert(entity2) .DoInsert(entity3) .DoInsert(entity4) .SaveAndContinue() // Second Part .DoInsert(statusMessage.SetPropertyValue(message =&gt; message.Message, $"Just got new message {entity1.Name}")) .EndTransaction(); </code></pre>