nbarbettini / little-aspnetcore-book

The Little ASP.NET Core Book, a friendly introduction to web programming and ASP.NET Core 2.0
http://littleasp.net/book
Creative Commons Attribution 4.0 International
701 stars 190 forks source link

Why don't we use AddDbContextPool instead of AddDbContext? #48

Closed sadqiang closed 6 years ago

sadqiang commented 6 years ago

New features in EF Core 2.0 explains there is AddDbContextPool for gaining high performance. Why don't we use it?

nbarbettini commented 6 years ago

Looks like a really cool feature!

Why don't we use it?

It's out of scope for this simple project. This book doesn't try to teach readers everything about EF Core. There are dedicated EF Core books just for that (if not, you should write one! 😄). The goal of this book is to get the reader interested in learning more.