I decided to use this AddDbContext method to add and setup my context for my Entity Framework Core project.
services.AddDbContext<ExampleContext>(options => options.UseSqlServer(Configuration.GetConnectionString("ExampleConnection")));
// https://stackoverflow.com/a/51970589/196526
I suppose this AddDbContext
allow us to add a global context and it is possible to retrieve it later when required in my controller or service class. How can I use it?