Upgrade to .net 5

Address breaking changes from Shogi.API nuget
This commit is contained in:
2021-01-23 18:11:19 -06:00
parent 1bbab8fe8f
commit 2c8e692d38
15 changed files with 71 additions and 99 deletions

View File

@@ -1,6 +1,7 @@
using AspShogiSockets.Extensions;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Linq;
using System.Net.WebSockets;
using System.Threading.Tasks;
@@ -31,16 +32,16 @@ namespace Websockets.Managers.ClientActionHandlers
? await repository.GetGames()
: await repository.GetGames(userName);
var games = getGamesResponse.Games
.OrderBy(g => g.Players.Contains(userName))
.Select(g => new Game
var games = getGamesResponse.Sessions
.OrderBy(s => s.Player1 == userName || s.Player2 == userName)
.Select(s => new Game
{
GameName = g.GameName,
Players = g.Players
GameName = s.Name,
Players = new[] { s.Player1, s.Player2 }
});
var response = new ListGamesResponse(ClientAction.ListGames)
{
Games = games ?? new Game[0]
Games = games ?? Array.Empty<Game>()
};
var serialized = JsonConvert.SerializeObject(response);