mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-28 16:08:38 +00:00
Utilize EF 7 bulk delete operations instead of RemoveRange
This commit is contained in:
parent
48c3384e0c
commit
f03d1d7c17
8 changed files with 17 additions and 21 deletions
|
@ -164,7 +164,7 @@ public class LoginController : ControllerBase
|
|||
}
|
||||
Logger.Info($"User's username has changed, old='{user.Username}', new='{npTicket.Username}', platform={npTicket.Platform}", LogArea.Login);
|
||||
user.Username = username;
|
||||
this.database.PlatformLinkAttempts.RemoveWhere(p => p.UserId == user.UserId);
|
||||
await this.database.PlatformLinkAttempts.RemoveWhere(p => p.UserId == user.UserId);
|
||||
// unlink other platforms because the names no longer match
|
||||
if (npTicket.Platform == Platform.RPCS3)
|
||||
user.LinkedPsnId = 0;
|
||||
|
|
|
@ -32,9 +32,8 @@ public class LogoutController : ControllerBase
|
|||
|
||||
user.LastLogout = TimeHelper.TimestampMillis;
|
||||
|
||||
this.database.GameTokens.RemoveWhere(t => t.TokenId == token.TokenId);
|
||||
this.database.LastContacts.RemoveWhere(c => c.UserId == token.UserId);
|
||||
await this.database.SaveChangesAsync();
|
||||
await this.database.GameTokens.RemoveWhere(t => t.TokenId == token.TokenId);
|
||||
await this.database.LastContacts.RemoveWhere(c => c.UserId == token.UserId);
|
||||
|
||||
return this.Ok();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue