This commit is contained in:
cmerkens 2025-01-09 14:49:40 +01:00
parent a9531e598b
commit d856e8f976
71 changed files with 1298 additions and 63 deletions

View File

@ -3,12 +3,8 @@
"WorkspaceRootPath": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\client.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\client.csproj||{FA3CD31E-987B-443A-9B81-186104E8DAC1}|"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\controllers\\webserviceclient.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
@ -17,6 +13,18 @@
{
"AbsoluteMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\server\\controllers\\gamecontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|solutionrelative:server\\controllers\\gamecontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\server\\repository\\gamerepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|solutionrelative:server\\repository\\gamerepository.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -26,7 +34,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 2,
"SelectedChildIndex": 1,
"Children": [
{
"$type": "Bookmark",
@ -34,54 +42,80 @@
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 0,
"Title": "Client",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Client.csproj",
"RelativeDocumentMoniker": "Client\\Client.csproj",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Client.csproj",
"RelativeToolTip": "Client\\Client.csproj",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000758|",
"WhenOpened": "2025-01-09T13:11:19.164Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 5,
"Title": "AddAndEditViewModel.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\AddAndEditViewModel.cs",
"RelativeDocumentMoniker": "Client\\ViewModels\\AddAndEditViewModel.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\AddAndEditViewModel.cs",
"RelativeToolTip": "Client\\ViewModels\\AddAndEditViewModel.cs",
"ViewState": "AgIAAFAAAAAAAAAAAAAUwAAAAAAAAAAAAAAAAA==",
"ViewState": "AgIAAA4AAAAAAAAAAAAQwC0AAAAEAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T08:38:01.885Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 4,
"Title": "MainWindowViewModel.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\MainWindowViewModel.cs",
"RelativeDocumentMoniker": "Client\\ViewModels\\MainWindowViewModel.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\MainWindowViewModel.cs",
"RelativeToolTip": "Client\\ViewModels\\MainWindowViewModel.cs",
"ViewState": "AgIAAMMAAAAAAAAAAAAAAFoAAAAuAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAHgAAAAIAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T08:33:45.454Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"DocumentIndex": 1,
"Title": "WebserviceClient.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeDocumentMoniker": "Client\\Controllers\\WebserviceClient.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeToolTip": "Client\\Controllers\\WebserviceClient.cs",
"ViewState": "AgIAAAgAAAAAAAAAAAAIwDAAAAAjAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:07:57.627Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "GameController.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeDocumentMoniker": "Server\\Controllers\\GameController.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeToolTip": "Server\\Controllers\\GameController.cs",
"ViewState": "AgIAACcAAAAAAAAAAAAAAEYAAAANAAAAAAAAAA==",
"ViewState": "AgIAAAYAAAAAAAAAAAAAAB8AAAA/AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:37:13.956Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "WebserviceClient.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeDocumentMoniker": "Client\\Controllers\\WebserviceClient.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeToolTip": "Client\\Controllers\\WebserviceClient.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAADAAAAAjAAAAAAAAAA==",
"DocumentIndex": 3,
"Title": "GameRepository.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Repository\\GameRepository.cs",
"RelativeDocumentMoniker": "Server\\Repository\\GameRepository.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Repository\\GameRepository.cs",
"RelativeToolTip": "Server\\Repository\\GameRepository.cs",
"ViewState": "AgIAAAUAAAAAAAAAAAA0wAAAAAAAAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:07:57.627Z",
"WhenOpened": "2025-01-09T13:06:31.582Z",
"EditorCaption": ""
}
]

View File

@ -2,10 +2,6 @@
"Version": 1,
"WorkspaceRootPath": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\",
"Documents": [
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\mainwindowviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
@ -17,6 +13,10 @@
{
"AbsoluteMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\server\\controllers\\gamecontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{851884DB-D3C1-4B36-B46C-FBB64390A1CB}|Server\\Server.csproj|solutionrelative:server\\controllers\\gamecontroller.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
},
{
"AbsoluteMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|c:\\git\\hochschule\\semester3\\dotnet\\abschlussprojekt\\client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}",
"RelativeMoniker": "D:0:0:{67E10324-BB6F-4756-BB1B-9C98702E92C9}|Client\\Client.csproj|solutionrelative:client\\viewmodels\\addandeditviewmodel.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}"
}
],
"DocumentGroupContainers": [
@ -26,7 +26,7 @@
"DocumentGroups": [
{
"DockedWidth": 200,
"SelectedChildIndex": 1,
"SelectedChildIndex": 2,
"Children": [
{
"$type": "Bookmark",
@ -34,55 +34,55 @@
},
{
"$type": "Document",
"DocumentIndex": 0,
"DocumentIndex": 3,
"Title": "AddAndEditViewModel.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\AddAndEditViewModel.cs",
"RelativeDocumentMoniker": "Client\\ViewModels\\AddAndEditViewModel.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\AddAndEditViewModel.cs",
"RelativeToolTip": "Client\\ViewModels\\AddAndEditViewModel.cs",
"ViewState": "AgIAACQAAAAAAAAAAAAAAB4AAAAgAAAAAAAAAA==",
"ViewState": "AgIAAC0AAAAAAAAAAAAwwFEAAAAJAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T08:38:01.885Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 1,
"DocumentIndex": 0,
"Title": "MainWindowViewModel.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\MainWindowViewModel.cs",
"RelativeDocumentMoniker": "Client\\ViewModels\\MainWindowViewModel.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\ViewModels\\MainWindowViewModel.cs",
"RelativeToolTip": "Client\\ViewModels\\MainWindowViewModel.cs",
"ViewState": "AgIAADsAAAAAAAAAAAAUwFoAAAAuAAAAAAAAAA==",
"ViewState": "AgIAAKoAAAAAAAAAAAAywMgAAAA7AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-09T08:33:45.454Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 3,
"Title": "GameController.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeDocumentMoniker": "Server\\Controllers\\GameController.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeToolTip": "Server\\Controllers\\GameController.cs",
"ViewState": "AgIAACcAAAAAAAAAAAAAAEYAAAANAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:37:13.956Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"DocumentIndex": 1,
"Title": "WebserviceClient.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeDocumentMoniker": "Client\\Controllers\\WebserviceClient.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Client\\Controllers\\WebserviceClient.cs",
"RelativeToolTip": "Client\\Controllers\\WebserviceClient.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAADAAAAAjAAAAAAAAAA==",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAB8AAAA8AAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:07:57.627Z",
"EditorCaption": ""
},
{
"$type": "Document",
"DocumentIndex": 2,
"Title": "GameController.cs",
"DocumentMoniker": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeDocumentMoniker": "Server\\Controllers\\GameController.cs",
"ToolTip": "C:\\Git\\Hochschule\\Semester3\\DotNET\\Abschlussprojekt\\Server\\Controllers\\GameController.cs",
"RelativeToolTip": "Server\\Controllers\\GameController.cs",
"ViewState": "AgIAAAAAAAAAAAAAAAAAAD0AAAAUAAAAAAAAAA==",
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|",
"WhenOpened": "2025-01-08T10:37:13.956Z",
"EditorCaption": ""
}
]
}

View File

@ -9,7 +9,7 @@
</PropertyGroup>
<ItemGroup>
<OpenApiReference Include="OpenAPIs\swagger2.json" CodeGenerator="NSwagCSharp" Options="/GenerateClientInterfaces:true" ClassName="ServiceClient">
<OpenApiReference Include="OpenAPIs\swagger3.json" CodeGenerator="NSwagCSharp" Options="/GenerateClientInterfaces:true" ClassName="ServiceClient">
<SourceUri>https://localhost:7118/swagger/v1/swagger.json</SourceUri>
</OpenApiReference>
</ItemGroup>
@ -34,6 +34,7 @@
<ItemGroup>
<None Update="OpenAPIs\swagger.json" ClassName="ServiceClient" />
<None Update="OpenAPIs\swagger1.json" ClassName="ServiceClient" />
<None Update="OpenAPIs\swagger2.json" ClassName="ServiceClient" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,312 @@
{
"openapi": "3.0.1",
"info": {
"title": "Server",
"version": "1.0"
},
"paths": {
"/api/Game": {
"get": {
"tags": [
"Game"
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Game"
}
}
},
"application/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Game"
}
}
},
"text/json": {
"schema": {
"type": "array",
"items": {
"$ref": "#/components/schemas/Game"
}
}
}
}
}
}
},
"post": {
"tags": [
"Game"
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "string"
}
},
"text/json": {
"schema": {
"type": "string"
}
},
"application/*+json": {
"schema": {
"type": "string"
}
}
}
},
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Server Error"
},
"400": {
"description": "Bad Request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
}
},
"/api/Game/{id}": {
"get": {
"tags": [
"Game"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Success",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/Game"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/Game"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/Game"
}
}
}
},
"400": {
"description": "Bad Request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
},
"put": {
"tags": [
"Game"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "string"
}
},
"text/json": {
"schema": {
"type": "string"
}
},
"application/*+json": {
"schema": {
"type": "string"
}
}
}
},
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Server Error"
},
"400": {
"description": "Bad Request",
"content": {
"text/plain": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
},
"text/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
}
}
},
"delete": {
"tags": [
"Game"
],
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int32"
}
}
],
"responses": {
"200": {
"description": "Success"
},
"500": {
"description": "Server Error"
}
}
}
}
},
"components": {
"schemas": {
"Game": {
"required": [
"titel",
"zustand"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"titel": {
"minLength": 1,
"type": "string"
},
"zustand": {
"$ref": "#/components/schemas/Zustand"
},
"kommentar": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
"ProblemDetails": {
"type": "object",
"properties": {
"type": {
"type": "string",
"nullable": true
},
"title": {
"type": "string",
"nullable": true
},
"status": {
"type": "integer",
"format": "int32",
"nullable": true
},
"detail": {
"type": "string",
"nullable": true
},
"instance": {
"type": "string",
"nullable": true
}
},
"additionalProperties": { }
},
"Zustand": {
"enum": [
0,
1,
2,
3
],
"type": "integer",
"format": "int32"
}
}
}
}

View File

@ -88,6 +88,7 @@ public class AddAndEditViewModel : ViewModelBase
// Methoden und Attribute für die Buttons
public bool dialogResult { get; set; }
public ICommand OkCommand { get; }
private void ExecuteOkCommand(object command)
{
@ -102,7 +103,7 @@ public class AddAndEditViewModel : ViewModelBase
}
else
{
this._view.DialogResult = true;
this.dialogResult = true;
this._view.Close();
}
}
@ -110,7 +111,7 @@ public class AddAndEditViewModel : ViewModelBase
public ICommand CancelCommand { get; }
private void ExecuteCancelCommand(object command)
{
this._view.DialogResult = false;
this.dialogResult = false;
this._view.Close();
}
}

View File

@ -1,8 +1,6 @@
using System;
using System.Collections.ObjectModel;
using System.IO;
using System.Net.Http;
using System.Text.Json;
using System.Windows;
using System.Windows.Input;
using System.Xml.Serialization;
@ -85,7 +83,7 @@ public class MainWindowViewModel : ViewModelBase
{
this.SwitchToExistingGame(existingGame);
}
else
else if (childWindow.dialogResult)
{
string response = await _serviceClient.AddGame(newGame);
this.ShowServerResponse(response);
@ -115,7 +113,7 @@ public class MainWindowViewModel : ViewModelBase
{
this.SwitchToExistingGame(existingGame);
}
else
else if (childWindow.dialogResult)
{
string response = await _serviceClient.EditGame(editedGame.Id, editedGame);
this.ShowServerResponse(response);

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Client")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa4b591275616aa1984ec69944b286e61fa0653e")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("Client")]
[assembly: System.Reflection.AssemblyTitleAttribute("Client")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
7b1d57af966ef2fe640c91f88c4dc5d8a9776d58a81bd443d5003a65c68c86fc
083a1d01552d8557015bb1b40136989407431c0de5e8c6a488d4d202ef3936e0

View File

@ -1 +1 @@
b6ad5558f11e242055df95cd8f4f2b6e562c1b35cbdc4c8ca00475cb19925d97
fb6ca91f55c5efcf74199d45e769c724a83d6558c3276e64bc83511d21240879

View File

@ -12,7 +12,7 @@ TRACE;DEBUG;NET;NET8_0;NETCOREAPP
C:\Git\Hochschule\Semester3\DotNET\Abschlussprojekt\Client\App.xaml
2-1372435843
13-1450451331
12-1116528086
350519948027
Views\MainWindow.xaml;Views\WindowAddAndEdit.xaml;

View File

@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Client")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("Client")]
[assembly: System.Reflection.AssemblyTitleAttribute("Client")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -0,0 +1 @@
083a1d01552d8557015bb1b40136989407431c0de5e8c6a488d4d202ef3936e0

View File

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Client_mca0hpyr_wpftmp
build_property.ProjectDir = C:\Git\Hochschule\Semester3\DotNET\Abschlussprojekt\Client\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -0,0 +1,6 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.Linq;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Client")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("Client")]
[assembly: System.Reflection.AssemblyTitleAttribute("Client")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -0,0 +1 @@
083a1d01552d8557015bb1b40136989407431c0de5e8c6a488d4d202ef3936e0

View File

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Client_ml1x3x4l_wpftmp
build_property.ProjectDir = C:\Git\Hochschule\Semester3\DotNET\Abschlussprojekt\Client\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -0,0 +1,6 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.Linq;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -0,0 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Dieser Code wurde von einem Tool generiert.
// Laufzeitversion:4.0.30319.42000
//
// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn
// der Code erneut generiert wird.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Client")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("Client")]
[assembly: System.Reflection.AssemblyTitleAttribute("Client")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
[assembly: System.Runtime.Versioning.TargetPlatformAttribute("Windows7.0")]
[assembly: System.Runtime.Versioning.SupportedOSPlatformAttribute("Windows7.0")]
// Von der MSBuild WriteCodeFragment-Klasse generiert.

View File

@ -0,0 +1 @@
083a1d01552d8557015bb1b40136989407431c0de5e8c6a488d4d202ef3936e0

View File

@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0-windows
build_property.TargetPlatformMinVersion = 7.0
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = Client_xvwt2niq_wpftmp
build_property.ProjectDir = C:\Git\Hochschule\Semester3\DotNET\Abschlussprojekt\Client\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =

View File

@ -0,0 +1,6 @@
// <auto-generated/>
global using global::System;
global using global::System.Collections.Generic;
global using global::System.Linq;
global using global::System.Threading;
global using global::System.Threading.Tasks;

View File

@ -61,7 +61,7 @@ namespace Client.Views {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Client;component/views/mainwindow.xaml", System.UriKind.Relative);
System.Uri resourceLocater = new System.Uri("/Client;V1.0.0.0;component/views/mainwindow.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\MainWindow.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);

View File

@ -53,7 +53,7 @@ namespace Client.Views {
return;
}
_contentLoaded = true;
System.Uri resourceLocater = new System.Uri("/Client;component/views/windowaddandedit.xaml", System.UriKind.Relative);
System.Uri resourceLocater = new System.Uri("/Client;V1.0.0.0;component/views/windowaddandedit.xaml", System.UriKind.Relative);
#line 1 "..\..\..\..\Views\WindowAddAndEdit.xaml"
System.Windows.Application.LoadComponent(this, resourceLocater);

View File

@ -0,0 +1,734 @@
//----------------------
// <auto-generated>
// Generated using the NSwag toolchain v13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0)) (http://NSwag.org)
// </auto-generated>
//----------------------
#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended."
#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword."
#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?'
#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ...
#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..."
#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'"
#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant"
#pragma warning disable 8603 // Disable "CS8603 Possible null reference return"
namespace Client
{
using System = global::System;
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial interface IServiceClient
{
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Game>> GameAllAsync();
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Game>> GameAllAsync(System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GamePOSTAsync(string body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GamePOSTAsync(string body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<Game> GameGETAsync(int id);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task<Game> GameGETAsync(int id, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GamePUTAsync(int id, string body);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GamePUTAsync(int id, string body, System.Threading.CancellationToken cancellationToken);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GameDELETEAsync(int id);
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
System.Threading.Tasks.Task GameDELETEAsync(int id, System.Threading.CancellationToken cancellationToken);
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class ServiceClient : IServiceClient
{
private string _baseUrl = "";
private System.Net.Http.HttpClient _httpClient;
private System.Lazy<Newtonsoft.Json.JsonSerializerSettings> _settings;
public ServiceClient(string baseUrl, System.Net.Http.HttpClient httpClient)
{
BaseUrl = baseUrl;
_httpClient = httpClient;
_settings = new System.Lazy<Newtonsoft.Json.JsonSerializerSettings>(CreateSerializerSettings);
}
private Newtonsoft.Json.JsonSerializerSettings CreateSerializerSettings()
{
var settings = new Newtonsoft.Json.JsonSerializerSettings();
UpdateJsonSerializerSettings(settings);
return settings;
}
public string BaseUrl
{
get { return _baseUrl; }
set { _baseUrl = value; }
}
protected Newtonsoft.Json.JsonSerializerSettings JsonSerializerSettings { get { return _settings.Value; } }
partial void UpdateJsonSerializerSettings(Newtonsoft.Json.JsonSerializerSettings settings);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url);
partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder);
partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response);
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Game>> GameAllAsync()
{
return GameAllAsync(System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Game>> GameAllAsync(System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Game");
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<System.Collections.Generic.ICollection<Game>>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task GamePOSTAsync(string body)
{
return GamePOSTAsync(body, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task GamePOSTAsync(string body, System.Threading.CancellationToken cancellationToken)
{
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Game");
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
return;
}
else
if (status_ == 500)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Server Error", status_, responseText_, headers_, null);
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task<Game> GameGETAsync(int id)
{
return GameGETAsync(id, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<Game> GameGETAsync(int id, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id");
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Game/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("GET");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("text/plain"));
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<Game>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return objectResponse_.Object;
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task GamePUTAsync(int id, string body)
{
return GamePUTAsync(id, body, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task GamePUTAsync(int id, string body, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id");
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Game/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = Newtonsoft.Json.JsonConvert.SerializeObject(body, _settings.Value);
var content_ = new System.Net.Http.StringContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("PUT");
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
return;
}
else
if (status_ == 500)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Server Error", status_, responseText_, headers_, null);
}
else
if (status_ == 400)
{
var objectResponse_ = await ReadObjectResponseAsync<ProblemDetails>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ProblemDetails>("Bad Request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual System.Threading.Tasks.Task GameDELETEAsync(int id)
{
return GameDELETEAsync(id, System.Threading.CancellationToken.None);
}
/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>Success</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task GameDELETEAsync(int id, System.Threading.CancellationToken cancellationToken)
{
if (id == null)
throw new System.ArgumentNullException("id");
var urlBuilder_ = new System.Text.StringBuilder();
urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/api/Game/{id}");
urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture)));
var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
request_.Method = new System.Net.Http.HttpMethod("DELETE");
PrepareRequest(client_, request_, urlBuilder_);
var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
PrepareRequest(client_, request_, url_);
var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value);
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}
ProcessResponse(client_, response_);
var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
return;
}
else
if (status_ == 500)
{
string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("Server Error", status_, responseText_, headers_, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}
protected struct ObjectResponseResult<T>
{
public ObjectResponseResult(T responseObject, string responseText)
{
this.Object = responseObject;
this.Text = responseText;
}
public T Object { get; }
public string Text { get; }
}
public bool ReadResponseAsString { get; set; }
protected virtual async System.Threading.Tasks.Task<ObjectResponseResult<T>> ReadObjectResponseAsync<T>(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Threading.CancellationToken cancellationToken)
{
if (response == null || response.Content == null)
{
return new ObjectResponseResult<T>(default(T), string.Empty);
}
if (ReadResponseAsString)
{
var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
var typedBody = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(responseText, JsonSerializerSettings);
return new ObjectResponseResult<T>(typedBody, responseText);
}
catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body string as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, responseText, headers, exception);
}
}
else
{
try
{
using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false))
using (var streamReader = new System.IO.StreamReader(responseStream))
using (var jsonTextReader = new Newtonsoft.Json.JsonTextReader(streamReader))
{
var serializer = Newtonsoft.Json.JsonSerializer.Create(JsonSerializerSettings);
var typedBody = serializer.Deserialize<T>(jsonTextReader);
return new ObjectResponseResult<T>(typedBody, string.Empty);
}
}
catch (Newtonsoft.Json.JsonException exception)
{
var message = "Could not deserialize the response body stream as " + typeof(T).FullName + ".";
throw new ApiException(message, (int)response.StatusCode, string.Empty, headers, exception);
}
}
}
private string ConvertToString(object value, System.Globalization.CultureInfo cultureInfo)
{
if (value == null)
{
return "";
}
if (value is System.Enum)
{
var name = System.Enum.GetName(value.GetType(), value);
if (name != null)
{
var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name);
if (field != null)
{
var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute))
as System.Runtime.Serialization.EnumMemberAttribute;
if (attribute != null)
{
return attribute.Value != null ? attribute.Value : name;
}
}
var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo));
return converted == null ? string.Empty : converted;
}
}
else if (value is bool)
{
return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant();
}
else if (value is byte[])
{
return System.Convert.ToBase64String((byte[]) value);
}
else if (value.GetType().IsArray)
{
var array = System.Linq.Enumerable.OfType<object>((System.Array) value);
return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo)));
}
var result = System.Convert.ToString(value, cultureInfo);
return result == null ? "" : result;
}
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class Game
{
[Newtonsoft.Json.JsonProperty("id", Required = Newtonsoft.Json.Required.DisallowNull, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int Id { get; set; }
[Newtonsoft.Json.JsonProperty("titel", Required = Newtonsoft.Json.Required.Always)]
[System.ComponentModel.DataAnnotations.Required]
public string Titel { get; set; }
[Newtonsoft.Json.JsonProperty("zustand", Required = Newtonsoft.Json.Required.Always)]
public Zustand Zustand { get; set; }
[Newtonsoft.Json.JsonProperty("kommentar", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Kommentar { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class ProblemDetails
{
[Newtonsoft.Json.JsonProperty("type", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Type { get; set; }
[Newtonsoft.Json.JsonProperty("title", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Title { get; set; }
[Newtonsoft.Json.JsonProperty("status", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public int? Status { get; set; }
[Newtonsoft.Json.JsonProperty("detail", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Detail { get; set; }
[Newtonsoft.Json.JsonProperty("instance", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public string Instance { get; set; }
private System.Collections.Generic.IDictionary<string, object> _additionalProperties;
[Newtonsoft.Json.JsonExtensionData]
public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
{
get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
set { _additionalProperties = value; }
}
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public enum Zustand
{
_0 = 0,
_1 = 1,
_2 = 2,
_3 = 3,
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class ApiException : System.Exception
{
public int StatusCode { get; private set; }
public string Response { get; private set; }
public System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> Headers { get; private set; }
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, System.Exception innerException)
: base(message + "\n\nStatus: " + statusCode + "\nResponse: \n" + ((response == null) ? "(null)" : response.Substring(0, response.Length >= 512 ? 512 : response.Length)), innerException)
{
StatusCode = statusCode;
Response = response;
Headers = headers;
}
public override string ToString()
{
return string.Format("HTTP Response: \n\n{0}\n\n{1}", Response, base.ToString());
}
}
[System.CodeDom.Compiler.GeneratedCode("NSwag", "13.18.2.0 (NJsonSchema v10.8.0.0 (Newtonsoft.Json v11.0.0.0))")]
public partial class ApiException<TResult> : ApiException
{
public TResult Result { get; private set; }
public ApiException(string message, int statusCode, string response, System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IEnumerable<string>> headers, TResult result, System.Exception innerException)
: base(message, statusCode, response, headers, innerException)
{
Result = result;
}
}
}
#pragma warning restore 1591
#pragma warning restore 1573
#pragma warning restore 472
#pragma warning restore 114
#pragma warning restore 108
#pragma warning restore 3016
#pragma warning restore 8603

View File

@ -20,6 +20,7 @@ namespace Server.Controllers
// GET: api/<GameController>
[HttpGet]
[ProducesResponseType<List<Game>>(StatusCodes.Status200OK)]
public ActionResult<List<Game>> Get()
{
return Ok(_repository.GetAllGames());
@ -27,9 +28,19 @@ namespace Server.Controllers
// GET api/<GameController>/5
[HttpGet("{id}")]
[ProducesResponseType<Game>(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public ActionResult<Game> Get(int id)
{
return Ok(_repository.GetGame(id));
Game result = _repository.GetGame(id);
if (result != null)
{
return Ok(result);
}
else
{
return BadRequest("Spiel konnte nicht gefunden werden");
}
}
// POST api/<GameController>

View File

@ -78,6 +78,15 @@
"text/json"
],
"StatusCode": 200
},
{
"Type": "Microsoft.AspNetCore.Mvc.ProblemDetails",
"MediaTypes": [
"text/plain",
"application/json",
"text/json"
],
"StatusCode": 400
}
]
},

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Server")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa4b591275616aa1984ec69944b286e61fa0653e")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("Server")]
[assembly: System.Reflection.AssemblyTitleAttribute("Server")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
c551d6f67e3daf0068b457f3a99a3abe7e113ce91ce908f3d8972aada614e01f
4f13070766e6c6ba195abcac19ccc6cf0231d70d66bdbb08e282336a298152b3

View File

@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TestServer")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+aa4b591275616aa1984ec69944b286e61fa0653e")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a9531e598bf00843b3888fb9200bb46cead09b88")]
[assembly: System.Reflection.AssemblyProductAttribute("TestServer")]
[assembly: System.Reflection.AssemblyTitleAttribute("TestServer")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View File

@ -1 +1 @@
50449644b2f05fc9b46fb7324d801ef9e1313acb13d172d5f042b141e55dfebe
f00261e083655f7fba73eaae5d4e3794b49c1c8bfd451e39deb517cb9934ecf7