0

以下代码不会为找到的记录更新我的数据库,并且在查看 Azure SQL Profiler 时,我只看到此更新语句。

update [dbo].[Identities]
set @p = 0
where ([Id] = @0)

和代码:

using (var db = new context())
{
    var member = db.Identities.Include("Member").Include("Roles")
                   .FirstOrDefault(i => id.Value == i.nameidentifier && i.identityprovider == provider.Value);

    if (member != null)
    {
        member.LastLoggedIn = DateTime.UtcNow;
        db.SaveChanges();
    }
}
4

0 回答 0