ajout du boardlayout et de la commande getmatch

This commit was merged in pull request #8.
This commit is contained in:
2025-03-26 22:21:07 +01:00
parent 7b00a91580
commit 899b1771d0
16 changed files with 374 additions and 25 deletions

View File

@@ -0,0 +1,43 @@
using Giants.Core.Interfaces;
namespace Giants.Core.Commands;
/// <summary>
/// Logique metier qui permet d'ajouter les données statiques aux matchs qui arrivent du repository
/// </summary>
public class GetMatchCommand : BaseCommand<GetMatchResult>
{
private IMatchRepository _repo;
/// <summary> L'id du match a récupérer </summary>
public required int MatchId { get; init; }
public GetMatchCommand(IMatchRepository repo)
{
_repo = repo;
}
protected override GetMatchResult LocalExecute()
{
Match? m = _repo.GetMatch(MatchId);
if (null != m)
{
GetMatchResult result = new GetMatchResult()
{
Success = true,
Match = m
};
return result;
}
return new GetMatchResult() { };
}
}
public class GetMatchResult : BaseCommandResult
{
/// <summary> Le match si success null sinon </summary>
public Match? Match { get; init; }
}