Check out example codes for "c# services.adddbcontext". It will help you in understanding the concepts better.
Code Example 1
public void ConfigureServices(IServiceCollection services)
{
var connectionString = "connection string to database";
services.AddDbContext<MyContext>(ServiceLifetime.Scoped);
}
Learn ReactJs, React Native from akashmittal.com