mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2026-05-17 12:31:25 +08:00
EF更新的时候,如果直接更新数据库里的记录,要以asnotracking执行查询,然后才能进行Entry操作!
This commit is contained in:
@@ -28,7 +28,7 @@ namespace OpenAuth.Repository
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public T FindSingle(Expression<Func<T, bool>> exp)
|
public T FindSingle(Expression<Func<T, bool>> exp)
|
||||||
{
|
{
|
||||||
return Context.Set<T>().FirstOrDefault(exp);
|
return Context.Set<T>().AsNoTracking().FirstOrDefault(exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user