Alk*_*sai 7 entity-framework-6 asp.net-identity
当尝试从两个并行线程更新身份时,我收到并IdentityResult包含此错误消息:Optimistic concurrency failure, object has been modified.
我想刷新模型并重试.像这样的东西.
var result = await UserManager.AddClaimAsync(memberIdentity, new Claim("abc", "cde"));
if(!result.Succeeded)
{
//reload identity or context
//retry
await UserManager.AddClaimAsync(memberIdentity, new Claim("abc", "cde"));
}
Run Code Online (Sandbox Code Playgroud)
关于如何重新加载身份或上下文的任何想法?
| 归档时间: |
|
| 查看次数: |
969 次 |
| 最近记录: |