From a2c738973643bb3aedb95e9cae06ff0fb0d18025 Mon Sep 17 00:00:00 2001 From: Simon Schulze Date: Mon, 23 Oct 2023 22:09:48 +0200 Subject: [PATCH] Add info model for cars in event --- .../Models/Results/CarListModel.cs | 10 ++++++++ .../Models/Results/EventCarInfoModel.cs | 23 +++++++++++++++++++ .../iRLeagueApiCore.Common.csproj | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 src/iRLeagueApiCore.Common/Models/Results/CarListModel.cs create mode 100644 src/iRLeagueApiCore.Common/Models/Results/EventCarInfoModel.cs diff --git a/src/iRLeagueApiCore.Common/Models/Results/CarListModel.cs b/src/iRLeagueApiCore.Common/Models/Results/CarListModel.cs new file mode 100644 index 0000000..0e4f002 --- /dev/null +++ b/src/iRLeagueApiCore.Common/Models/Results/CarListModel.cs @@ -0,0 +1,10 @@ +namespace iRLeagueApiCore.Common.Models.Results; + +[DataContract] +public sealed class CarListModel +{ + [DataMember] + public bool IsTeamEvent { get; set; } + [DataMember] + public IEnumerable Cars { get; set; } = Array.Empty(); +} diff --git a/src/iRLeagueApiCore.Common/Models/Results/EventCarInfoModel.cs b/src/iRLeagueApiCore.Common/Models/Results/EventCarInfoModel.cs new file mode 100644 index 0000000..12846fb --- /dev/null +++ b/src/iRLeagueApiCore.Common/Models/Results/EventCarInfoModel.cs @@ -0,0 +1,23 @@ +namespace iRLeagueApiCore.Common.Models.Results; + +/// +/// Contains information about a specific car in an event and it's driver(s) or team +/// +[DataContract] +public sealed class EventCarInfoModel +{ + [DataMember] + public int Number { get; set; } + [DataMember] + public string Car { get; set; } = string.Empty; + [DataMember] + public int CarId { get; set; } + [DataMember] + public int ClassId { get;} + [DataMember] + public string Class { get; set; } = string.Empty; + [DataMember] + public MemberInfoModel? Member { get; set; } + [DataMember] + public TeamInfoModel? Team { get; set; } +} diff --git a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj index b2f8a44..f1824b6 100644 --- a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj +++ b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj @@ -18,7 +18,7 @@ Library net6.0 iRLeagueApiCore.Common - 0.10.0-dev.4 + 0.10.0-dev.5 Simon Schulze Simon Schulze enable