skip to Main Content

What is the lifetime of DbContext? – Asp.net

On Startup.cs, the application establishes connection with the database. services.AddDbContext<DataContext>(opt=> opt.UseSqlLite(_config.GetCinnectionString(‘DefaultConnectionString’)); }); This opt object of the now established database connection is injected as options to the DataContext class- public class DataContext:DbContext { public DataContext(DbContextOptions options):base(options) } And further on,…

VIEW QUESTION
Back To Top
Search