using System.Net.Http; namespace Client.Controllers; using System.Text.Json; // https://stackoverflow.com/questions/60256300/swaggerui-5-0-0-ignoring-jsonproperty-name public class WebserviceClient { private ServiceClient _serviceClient; private string _jsonSerializer; public WebserviceClient(ServiceClient serviceClient) { this._serviceClient = serviceClient; } public async Task> GetAllGames() { var response = (List) await this._serviceClient.GameAllAsync(); return response; } public async Task GetGame(int id) { var response = (Game) await this._serviceClient.GameGETAsync(id); return response; } public async Task AddGame(Game game) { _jsonSerializer = JsonSerializer.Serialize(game); // Wie kriege ich die Message hier rein await _serviceClient.GamePOSTAsync(_jsonSerializer); return "response AddGame"; } public async Task EditGame(int id, Game game) { _jsonSerializer = JsonSerializer.Serialize(game); // Wie kriege ich die Message hier rein await _serviceClient.GamePUTAsync(id, _jsonSerializer); return "response EditGame"; } public async Task DeleteGame(int id) { // Wie kriege ich die Message hier rein await _serviceClient.GameDELETEAsync(id); return "response DeleteGame"; } }