openIddict缺少AddEntityFrameworkCoreStores定义

时间:2018-05-30 08:57:27

标签: openiddict

扩展方法AddEntityFrameworkCoreStores未按预期工作。我收到错误消息,表明OpenIddictCoreBuilder没有AddEntityFrameworkCoreStores定义。

// Register the OpenIddict services.
services.AddOpenIddict(options =>
{
    // Register the Entity Framework stores.
    options.AddCore().AddEntityFrameworkCoreStores<ApplicationDbContext>();

我的项目中有using个:

using System;
using System.Threading.Tasks;
using AspNet.Security.OpenIdConnect.Primitives;
using AuthorizationServer.Models;
using AuthorizationServer.Services;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Identity;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using OpenIddict.Abstractions;
using OpenIddict.Core;
using OpenIddict.EntityFrameworkCore.Models;

1 个答案:

答案 0 :(得分:0)

RC3中的语法已更改:

services.AddOpenIddict()

    // Register the OpenIddict core services.
    .AddCore(options =>
    {
        options.UseEntityFrameworkCore()
               .UseDbContext<ApplicationDbContext>();
    });

您可以在此处阅读公告:https://github.com/openiddict/openiddict-core/issues/608