LANCommander/LANCommander.SDK/Services/PlaySessionService.cs

36 lines
958 B
C#
Raw Permalink Normal View History

2025-08-18 03:00:08 -05:00
using LANCommander.SDK.Models;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace LANCommander.SDK.Services
{
public class PlaySessionService
{
2025-08-18 03:02:49 -05:00
private readonly ILogger _logger;
private readonly Client _client;
public PlaySessionService(Client client)
{
2025-08-18 03:02:49 -05:00
_client = client;
}
public PlaySessionService(Client client, ILogger logger)
{
2025-08-18 03:02:49 -05:00
_client = client;
_logger = logger;
}
public async Task<IEnumerable<EntityReference>> GetAsync()
{
2025-08-18 03:02:49 -05:00
return await _client.GetRequestAsync<IEnumerable<EntityReference>>("/api/PlaySessions");
}
public async Task<IEnumerable<PlaySession>> GetAsync(Guid gameId)
{
2025-08-18 03:02:49 -05:00
return await _client.PostRequestAsync<IEnumerable<PlaySession>>($"/api/PlaySessions/{gameId}");
}
}
}