Browse Source

Update README.md and the Mvc.Server sample to use the new Entity Framework context registration syntax

pull/152/head
Orlando Quero 10 years ago
committed by Kévin Chalet
parent
commit
5838c24a85
  1. 6
      README.md
  2. 7
      samples/Mvc.Server/Startup.cs

6
README.md

@ -64,10 +64,8 @@ To use OpenIddict, you need to:
public void ConfigureServices(IServiceCollection services) {
services.AddMvc();
services.AddEntityFramework()
.AddSqlServer()
.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
// Register the Identity services.
services.AddIdentity<ApplicationUser, IdentityRole>()

7
samples/Mvc.Server/Startup.cs

@ -4,7 +4,6 @@ using CryptoHelper;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Mvc.Server.Models;
@ -24,10 +23,8 @@ namespace Mvc.Server {
services.AddSession();
services.AddEntityFramework()
.AddEntityFrameworkSqlServer()
.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(configuration["Data:DefaultConnection:ConnectionString"]));
services.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(configuration["Data:DefaultConnection:ConnectionString"]));
// Register the Identity services.
services.AddIdentity<ApplicationUser, IdentityRole<Guid>>()

Loading…
Cancel
Save