Я использую аутентификацию в -net Core 2 api, и я обнаружил эту ошибку после этого кода:
StartUp.cs:
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
services.AddIdentity<IdentityUser, IdentityRole>()
.AddEntityFrameworkStores<MyContext>()
.AddDefaultTokenProviders();
MyContext.cs:
using Microsoft.AspNetCore.Identity;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
public class MyContext: IdentityDbContext<IdentityUser>
{
public MyContext(DbContextOptions<MyContext> opt)
: base(opt) { }
public DbSet<Room> Rooms{ get; set; }
}
Ошибка в MyCOntext.cs:
'IdentityUser' is an ambiguous reference between 'Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser' and 'Microsoft.AspNetCore.Identity.IdentityUser'
Спасибо всем.