I'm trying to create authorization and authentication from scratch using the new Identity scaffolding in the new .Net Core 2.1 but keep getting this error.
SqlException: Invalid object name 'AspNetUsers'.
RegisterModel fails to execute on this line:
var result = await _userManager.CreateAsync(user, Input.Password);
IDENTITYHOSTINGSTARTUP.CS
[assembly: HostingStartup(typeof(Authorize.Areas.Identity.IdentityHostingStartup))]
namespace Authorize.Areas.Identity
{
public class IdentityHostingStartup : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
builder.ConfigureServices((context, services) => {
services.AddDbContext<AuthorizeContext>(options =>
options.UseSqlServer(
context.Configuration.GetConnectionString("AuthorizeContextConnection")));
services.AddDefaultIdentity<AuthorizeUser>()
.AddEntityFrameworkStores<AuthorizeContext>()
.AddDefaultTokenProviders();
});
}
}
}