Where to put code to run after startup is completed

Probably the best place is in Configure method after UseMvc() call. That is also the place where you usually apply migrations. You can add as many classes that DI knows as parameter.
For example:

public void Configure(IApplicationBuilder app)

or

public void Configure(IApplicationBuilder app, AppUserManager userManager, IServiceProvider serviceProvider)

or

public void Configure(IApplicationBuilder app, MyDbContext context)

If you want to check this in background (only if you don’t care about result – application should run also if verification fails), check my answer here.
Also this answer may help you.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)