2.4: Registering Auth Service
public void ConfigureServices(IServiceCollection services)
{
services.AddDbContext<EFConnectContext>(x => x.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddMvc();
services.AddScoped<IAuthService, AuthService>(); // registering our AuthService
}Transient vs. Singleton vs. Scoped
Last updated