Added Reset All Equipped Builds Button
This commit is contained in:
parent
0ac8fec909
commit
7de720cab3
2 changed files with 28 additions and 1 deletions
|
@ -51,5 +51,16 @@ namespace Lieb.Data
|
|||
using var context = _contextFactory.CreateDbContext();
|
||||
return context.GuildWars2Builds.FirstOrDefault(b => b.GuildWars2BuildId == buildId);
|
||||
}
|
||||
|
||||
public async Task ResetAllEquipped()
|
||||
{
|
||||
using var context = _contextFactory.CreateDbContext();
|
||||
List<Equipped> buildsToRemove = context.Equipped.ToList();
|
||||
if (buildsToRemove.Count > 0)
|
||||
{
|
||||
context.Equipped.RemoveRange(buildsToRemove);
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue