diff --git a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj
index fb04c894..41ab0439 100644
--- a/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj
+++ b/src/iRLeagueApiCore.Client/iRLeagueApiCore.Client.csproj
@@ -13,7 +13,7 @@
Library
net8.0
iRLeagueApiCore.Client
- 0.14.6
+ 0.14.7
Simon Schulze
Simon Schulze
This package contains shared objects for all members of the iRLeagueDatabase-iRLeagueApi stack
diff --git a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj
index ce1a59fc..31a4f303 100644
--- a/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj
+++ b/src/iRLeagueApiCore.Common/iRLeagueApiCore.Common.csproj
@@ -18,7 +18,7 @@
Library
net8.0
iRLeagueApiCore.Common
- 0.14.6
+ 0.14.7
Simon Schulze
Simon Schulze
enable
diff --git a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj
index 0f38ae24..aadd4549 100644
--- a/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj
+++ b/src/iRLeagueApiCore.Server/iRLeagueApiCore.Server.csproj
@@ -78,7 +78,7 @@
true
- 0.14.6
+ 0.14.7
enable
diff --git a/src/iRLeagueApiCore.Services/ResultService/Calculation/MemberStandingCalculationService.cs b/src/iRLeagueApiCore.Services/ResultService/Calculation/MemberStandingCalculationService.cs
index 3011e4df..ab0b4ae5 100644
--- a/src/iRLeagueApiCore.Services/ResultService/Calculation/MemberStandingCalculationService.cs
+++ b/src/iRLeagueApiCore.Services/ResultService/Calculation/MemberStandingCalculationService.cs
@@ -74,7 +74,9 @@ public override Task Calculate(StandingCalculationDat
.OrderBy(GetDropweekOverrideOrderValue);
var currentResult = currentMemberResult.GetValueOrDefault(memberId);
var standingRow = new StandingRowCalculationResult();
- var lastResult = currentResult ?? previousEventResults.FirstOrDefault();
+ var lastResult = currentResult ?? previousEventResults
+ .OrderBy(x => x.EventResult.Date)
+ .LastOrDefault();
var lastRow = lastResult?.SessionResults.LastOrDefault()?.ResultRow;
if (lastRow is null)
{
diff --git a/src/iRLeagueApiCore.Services/ResultService/DataAccess/EventCalculationDataProvider.cs b/src/iRLeagueApiCore.Services/ResultService/DataAccess/EventCalculationDataProvider.cs
index 28537d3a..791f96c9 100644
--- a/src/iRLeagueApiCore.Services/ResultService/DataAccess/EventCalculationDataProvider.cs
+++ b/src/iRLeagueApiCore.Services/ResultService/DataAccess/EventCalculationDataProvider.cs
@@ -156,6 +156,7 @@ private static bool LapIsValid(TimeSpan lap)
{
LeagueId = eventResult.LeagueId,
EventId = eventResult.EventId,
+ Date = eventResult.Event.Date,
SessionResults = eventResult.SessionResults
.OrderBy(sessionResult => sessionResult.Session.SessionNr)
.Select(sessionResult => new SessionCalculationData()
@@ -229,6 +230,7 @@ private static bool LapIsValid(TimeSpan lap)
{
LeagueId = eventResult.LeagueId,
EventId = eventResult.EventId,
+ Date = eventResult.Event.Date,
SessionResults = eventResult.ScoredSessionResults
.OrderBy(sessionResult => sessionResult.SessionNr)
.Select(sessionResult => new SessionCalculationData()
diff --git a/src/iRLeagueApiCore.Services/ResultService/DataAccess/StandingCalculationDataProvider.cs b/src/iRLeagueApiCore.Services/ResultService/DataAccess/StandingCalculationDataProvider.cs
index 55164f5a..bdbe1b98 100644
--- a/src/iRLeagueApiCore.Services/ResultService/DataAccess/StandingCalculationDataProvider.cs
+++ b/src/iRLeagueApiCore.Services/ResultService/DataAccess/StandingCalculationDataProvider.cs
@@ -90,6 +90,7 @@ private async Task> GetPreviousResultsAsync(
{
LeagueId = eventResult.LeagueId,
EventId = eventResult.EventId,
+ Date = eventResult.Event.Date,
Name = eventResult.Name,
ResultConfigId = eventResult.ResultConfigId,
ResultId = eventResult.ResultId,
diff --git a/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationData.cs b/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationData.cs
index fe85018b..f62131ab 100644
--- a/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationData.cs
+++ b/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationData.cs
@@ -4,6 +4,7 @@ internal sealed class EventCalculationData
{
public long LeagueId { get; set; }
public long EventId { get; set; }
+ public DateTime? Date { get; set; }
public IEnumerable AddPenalties { get; set; } = Array.Empty();
public IEnumerable SessionResults { get; set; } = Array.Empty();
}
diff --git a/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationResult.cs b/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationResult.cs
index d5f4e5fe..eb81debb 100644
--- a/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationResult.cs
+++ b/src/iRLeagueApiCore.Services/ResultService/Models/EventCalculationResult.cs
@@ -8,10 +8,12 @@ public EventCalculationResult(EventCalculationData data)
{
LeagueId = data.LeagueId;
EventId = data.EventId;
+ Date = data.Date;
}
public long LeagueId { get; set; }
public long EventId { get; set; }
+ public DateTime? Date { get; set; }
public long? ResultId { get; set; }
public long? ChampSeasonId { get; set; }
public long? ResultConfigId { get; set; }
diff --git a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj
index 8e40a3d7..375f8a7a 100644
--- a/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj
+++ b/src/iRLeagueDatabaseCore/iRLeagueDatabaseCore.csproj
@@ -35,7 +35,7 @@
net8.0
12
iRLeagueDatabaseCore
- 0.14.6
+ 0.14.7
enable