Fixed game deletions
This commit is contained in:
parent
ab25a75c0c
commit
8630ff7079
2 changed files with 4 additions and 2 deletions
|
|
@ -41,12 +41,12 @@ namespace LANCommander.Services
|
|||
|
||||
public override async Task Delete(Game game)
|
||||
{
|
||||
foreach (var archive in game.Archives.OrderByDescending(a => a.CreatedOn))
|
||||
foreach (var archive in game.Archives.ToList())
|
||||
{
|
||||
await ArchiveService.Delete(archive);
|
||||
}
|
||||
|
||||
foreach (var media in game.Media)
|
||||
foreach (var media in game.Media.ToList())
|
||||
{
|
||||
await MediaService.Delete(media);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -254,6 +254,8 @@
|
|||
try
|
||||
{
|
||||
await GameService.Delete(game);
|
||||
|
||||
MessageService.Success($"{game.Title} was successfully deleted!");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue