I keep getting this error for the last two frameworks that I have included. I have searched up and down. Can't figure what it is. I have installed the NuGet packages and tried to recompile multiple times. Nothing is working. Here is my code.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IdentityUser;
using IdentityDbContext;
namespace UserProfileInfo.Models
{
public class UserProfile : IdentityUser
{
public virtual UserProfile UserInfo { get; set; }
}
public class UserProfileDB
{
public int Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
public class MyDbContext : IdentityDbContext<UserProfile>
{
public MyDbContext()
: base("DefaultConnection")
{
}
public System.Data.Entity.DbSet<UserProfile> UserInfo { get; set; }
}
}
This is for Dotnet Core and you will not receive any warning
using Microsoft.Extensions.Identity.Stores
There is no needs for -
using IdentityUser;
using IdentityDbContext;
Instead you need to add following -
using Microsoft.AspNet.Identity.EntityFramework;
Make sure you have that DLL as a reference as shown below. If it is not available, then you can get that nuget from here.
For AspNet Core 1 use NuGet:
Microsoft.AspNetCore.Identity.EntityFrameworkCore
For AspNet Core 2 use NuGet:
Microsoft.AspNetCore.Identity
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With