【发布时间】:2015-08-08 03:34:29
【问题描述】:
我已经在我的 Users 表中添加了一个已删除的 at 列,但显然由 Identity 框架提供的注册新用户方法仍然会在数据库中看到这些用户,有没有办法告诉它忽略某个列?
注册
// this needs to ignore any DeletedAt where not null
var result = await UserManager.CreateAsync(user, model.Password);
if (result.Succeeded)
{
...
}
登录
// this needs to ignore any DeletedAt where not null
result = await SignInManager.PasswordSignInAsync( user.UserName, model.Password, model.RememberMe, shouldLockout: true );
...任何其他正在进行的外部登录事情都需要被告知该专栏。
【问题讨论】:
-
登录:你想检查用户是否“被删除”而不让他登录?关于注册有什么问题?
-
只继承
SignInManager并添加检查IsDeleted -
tmg - 我不希望允许已删除用户登录的登录方法.../谢谢 trailmax
标签: c# entity-framework asp.net-mvc-5 asp.net-identity-2