Mid From PDF EF Core Entity Framework Core

How to implement unit of work with EF Core?

public interface IUnitOfWork : IDisposable
{

IRepository<Customer> Customers { get; }

IRepository<Order> Orders { get; }

Task<int> CommitAsync();

}
  • Implementation typically injects a single DbContext instance shared across

repositories.

  • CommitAsync() calls DbContext.SaveChangesAsync().

More from Entity Framework Core Tutorial

All questions for this course
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details