このエラーが出る:RequireUniqueEmail = false
を。あなたはApplicationUserManager
クラスのコンストラクタでそれを設定する必要があるかもしれません
public static ApplicationUserManager Create(IdentityFactoryOptions<ApplicationUserManager> options, IOwinContext context)
{
var manager = new ApplicationUserManager(new UserStore<ApplicationUser>(context.Get<ApplicationDbContext>()));
// Configure validation logic for usernames
manager.UserValidator = new UserValidator<ApplicationUser>(manager)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = false
};
...
return manager;
}
:個々のユーザーアカウントと既定のMVC5のためのコード例 `RequireUniqueEmail = false`を:
public ApplicationUserManager(IUserStore<ApplicationUser> store) : base(store)
{
UserValidator = new UserValidator<ApplicationUser>(this)
{
AllowOnlyAlphanumericUserNames = false,
RequireUniqueEmail = true
};
}
出典
2017-03-04 15:08:28
tmg
あなたは' UserManager'の 'UserValidator'を設定することができます – tmg
ありがとうございます。あなたは私の時間を救った。私はUserManagerクラスをオーバーライドしてブームを起こしています。ありがとう。 –
あなたの投稿に懇願しないでください。私はこれをもう一度編集しました。あなたがロールバックしたので、司会者にそれを見てもらうよう依頼します。 [このコミュニティの議論を読む](https://meta.stackoverflow.com/q/326569/472495)。 – halfer