I have separated my identity code into a dedicated class library. I have an IServiceCollection
extension method for adding everything I need except this one line:
builder.Services.AddIdentityApiEndpoints<IdentityUser>()
.AddEntityFrameworkStores<ApplicationDbContext>();
No matter which package I include, AddIdentityApiEndpoints
is never recognized. What do I need to do to be able to use AddIdentityApiEndpoints
from within a class library?
The documentation page's "Definition" section is terse, but it essentially says that you need to have:
<FrameworkReference>
to Microsoft.AspNetCore.App.Ref
in your .csproj
.<PackageReference>
to Microsoft.Extensions.Identity.Core
in your .csproj
.using Microsoft.Extensions.DependencyInjection
namespace import in your Startup.cs