how to add dbcontext in asp.net core code example
Example: c# services.adddbcontext
public void ConfigureServices(IServiceCollection services)
{
var connectionString = "connection string to database";
services.AddDbContext<MyContext>(ServiceLifetime.Scoped);
}