April 2017
Intermediate to advanced
564 pages
24h 7m
English
We can add the Entity Framework and Identity as middleware. ConfigureServices is the entry point where all services are added and called by runtime.
Add the following code snippet in the ConfigureServices method to add Entity Framework:
services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString( "DefaultConnection")));
Next, we can add Identity, as follows:
services.AddEntityFrameworkSqlServer() .AddDbContext<ApplicationDbContext>(options => options.UseSqlServer( Configuration.GetConnectionString("DefaultConnection"))); .AddDefaultTokenProviders();
To add the SQL Server support, we have to call the AddEntityFrameworkSqlServer method ...
Read now
Unlock full access