Skip to content

Commit

Permalink
Overwrite profile if it already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Jul 6, 2024
1 parent afecd84 commit 6fe48aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ReplayBrowser/Services/ProfilePregeneratorService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ private async void PregenerateProfiles()
{
try
{
if (dbContext.PlayerProfiles.Any(x => x.PlayerGuid == guid))
{
// overwrite existing profile
dbContext.PlayerProfiles.RemoveRange(dbContext.PlayerProfiles.Where(x => x.PlayerGuid == guid));
await dbContext.SaveChangesAsync();
}
dbContext.PlayerProfiles.Add(generated);
await dbContext.SaveChangesAsync();
}
Expand Down

0 comments on commit 6fe48aa

Please sign in to comment.