Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/319.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 没有从ApplicationUser到Microsoft.AspNet.Identity.EntityFramework.IdentityUser的隐式引用转换_C#_Entity Framework_Asp.net Identity - Fatal编程技术网

C# 没有从ApplicationUser到Microsoft.AspNet.Identity.EntityFramework.IdentityUser的隐式引用转换

C# 没有从ApplicationUser到Microsoft.AspNet.Identity.EntityFramework.IdentityUser的隐式引用转换,c#,entity-framework,asp.net-identity,C#,Entity Framework,Asp.net Identity,我正在尝试在UserStore的泛型参数上传递一个自定义的IdentityUser。 因此,我继承了IdentityUser并用它的必需泛型参数实现了所有必需的接口 using Microsoft.AspNet.Identity; using Microsoft.AspNet.Identity.EntityFramework; using System; class Program { static void Main(string[] args) { var

我正在尝试在UserStore的泛型参数上传递一个自定义的IdentityUser。 因此,我继承了IdentityUser并用它的必需泛型参数实现了所有必需的接口

using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using System;

class Program
{
    static void Main(string[] args)
    {
        var userStore = new UserStore<AppUser>(); //This is line that's triggering the error. AppUser has inherited all IdentityUser requirements, but I am not sure what I am missing here.
    }
}
使用Microsoft.AspNet.Identity;
使用Microsoft.AspNet.Identity.EntityFramework;
使用制度;
班级计划
{
静态void Main(字符串[]参数)
{

var userStore=new userStore,但它的标识不像我在代码中所做的那样是自定义的。

以下是我的答案,我只是错过了定义,而对Intellisense的敏锐关注可以解决这种情况:

var userStore = new UserStore<AppUser, AppRole, int, AppLogin, AppUserRole, AppClaim>(new MyDbContext(""));
var userStore = new UserStore<AppUser, AppRole, int, AppLogin, AppUserRole, AppClaim>(new MyDbContext(""));
public class AppUser : IdentityUser<int, AppLogin, AppUserRole, AppClaim>
{}

public class AppLogin : IdentityUserLogin<int>
{}

public class AppUserRole : IdentityUserRole<int>
{}

public class AppClaim : IdentityUserClaim<int>
{}

public class AppRole : IdentityRole<int, AppUserRole>
{}
var userStoreSimplified = new UserStore<AppUserSimplified>();
public class AppUserSimplified : IdentityUser
{}