From ecbf822027085b03f31082bc3da47f6cc55a3641 Mon Sep 17 00:00:00 2001 From: sven-n Date: Mon, 6 May 2024 20:25:42 +0200 Subject: [PATCH] code style fixes --- src/Persistence/ByDataSourceReferenceHandler.cs | 2 +- src/Persistence/ByDataSourceReferenceResolver.cs | 2 +- src/Startup/Program.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Persistence/ByDataSourceReferenceHandler.cs b/src/Persistence/ByDataSourceReferenceHandler.cs index 42c7d70e3..1e507f562 100644 --- a/src/Persistence/ByDataSourceReferenceHandler.cs +++ b/src/Persistence/ByDataSourceReferenceHandler.cs @@ -15,7 +15,7 @@ public class ByDataSourceReferenceHandler : ReferenceHandler /// /// The data source. /// - private IDataSource _dataSource; + private readonly IDataSource _dataSource; /// /// Initializes a new instance of the class. diff --git a/src/Persistence/ByDataSourceReferenceResolver.cs b/src/Persistence/ByDataSourceReferenceResolver.cs index 0e8a2b725..fedf7a1fa 100644 --- a/src/Persistence/ByDataSourceReferenceResolver.cs +++ b/src/Persistence/ByDataSourceReferenceResolver.cs @@ -29,7 +29,7 @@ public ByDataSourceReferenceResolver(IDataSource dataSource) /// public override void AddReference(string referenceId, object value) { - //throw new NotImplementedException(); + // do nothing here, because the data source is the source of truth. } /// diff --git a/src/Startup/Program.cs b/src/Startup/Program.cs index ee3447bae..11825454d 100644 --- a/src/Startup/Program.cs +++ b/src/Startup/Program.cs @@ -274,8 +274,8 @@ private async Task CreateHostAsync(string[] args) var dataSource = new GameConfigurationDataSource( provider.GetService>()!, persistenceContextProvider!); - var configId = persistenceContextProvider!.CreateNewConfigurationContext().GetDefaultGameConfigurationIdAsync(default).GetAwaiter().GetResult(); - dataSource.GetOwnerAsync(configId!.Value).GetAwaiter().GetResult(); + var configId = persistenceContextProvider!.CreateNewConfigurationContext().GetDefaultGameConfigurationIdAsync(default).AsTask().WaitAndUnwrapException(); + dataSource.GetOwnerAsync(configId!.Value).AsTask().WaitAndUnwrapException(); var referenceHandler = new ByDataSourceReferenceHandler(dataSource); return referenceHandler; })