我有以下用户商店:
public class UserStoreService<T> : UserStore<T> where T : IdentityUser
{
public UserStoreService(MainDbContext context)
: base(context)
{
}
}
在我的启动中,我需要将它与另一个库中的自定义用户绑定。我试图避免在我的项目中完全引用该库。我引用了接口,这就是我在整个项目中用来访问属性等的接口。我想不通的是如何动态绑定以下语句:
kernel.Bind<IUserStore<MyCustomUser>>().To<UserStoreService<MyCustomUser>>();
MyCustomUser
延伸IdentityUser