diff --git a/.github/workflows/dotnetcore.yml b/.github/workflows/dotnetcore.yml index 2b61d1322..142db66f1 100644 --- a/.github/workflows/dotnetcore.yml +++ b/.github/workflows/dotnetcore.yml @@ -12,6 +12,6 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 5.0.100 + dotnet-version: 6.0.100 - name: Build with dotnet run: dotnet publish src/Startup/MUnique.OpenMU.Startup.csproj --configuration Release -p:ci=true diff --git a/Dockerfile b/Dockerfile index 74f606d78..0710b8c34 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build # Requirements for the typescript compiler RUN apt-get update && \ @@ -14,7 +14,7 @@ RUN dotnet build src/Startup/MUnique.OpenMU.Startup.csproj -c Release -p:ci=true RUN dotnet publish src/AdminPanel/MUnique.OpenMU.AdminPanel.csproj -o out -c Release --no-build RUN dotnet publish src/Startup/MUnique.OpenMU.Startup.csproj -o out -c Release --no-build -FROM mcr.microsoft.com/dotnet/aspnet:5.0 AS runtime +FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS runtime EXPOSE 1234 EXPOSE 55901 diff --git a/QuickStart.md b/QuickStart.md index 4fa561211..69a4e1519 100644 --- a/QuickStart.md +++ b/QuickStart.md @@ -106,10 +106,10 @@ Requirements: * PostgreSQL installed - * Visual Studio 2019 (16.8) installed + * Visual Studio 2022 (17.0) installed - * [.NET Core SDK SDK 5.0.100](https://dotnet.microsoft.com/download/dotnet/5.0) - (it should be included in Visual Studio 16.8) + * [.NET Core SDK SDK 6.0.100](https://dotnet.microsoft.com/download/dotnet/6.0) + (it should be included in Visual Studio 17.0) * This repository cloned diff --git a/README.md b/README.md index 3744ccf15..2c78e1983 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This project is released under the MIT license (see LICENSE file). ## Used technologies -The project is mainly written in C# and targets .NET 5.0. +The project is mainly written in C# and targets .NET 6.0. The servers admin panel is hosted on an embedded ASP.NET Core webserver (Kestrel) and implemented as Blazor Server App. @@ -57,7 +57,7 @@ Contributions are welcome if they meet the following criteria: * Language is english. * Code should be StyleCop compliant - this project uses the [StyleCop.Analyzers](https://www.nuget.org/packages/StyleCop.Analyzers/) - for VS2019 so you should see issues directly as warnings. + for VS2022 so you should see issues directly as warnings. * Coding style (naming, etc.) and quality should fit to the current state. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6ad4eb53..cd1239613 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ trigger: - master pool: - vmImage: 'windows-2019' + vmImage: 'windows-2022' variables: buildConfiguration: 'Release' diff --git a/src/AdminPanel/Components/Form/AutoForm.razor b/src/AdminPanel/Components/Form/AutoForm.razor index 8fe1742b0..a0a5a2c18 100644 --- a/src/AdminPanel/Components/Form/AutoForm.razor +++ b/src/AdminPanel/Components/Form/AutoForm.razor @@ -1,4 +1,4 @@ -@typeparam T; +@typeparam T diff --git a/src/AdminPanel/MUnique.OpenMU.AdminPanel.csproj b/src/AdminPanel/MUnique.OpenMU.AdminPanel.csproj index 78e492b09..e82cfe543 100644 --- a/src/AdminPanel/MUnique.OpenMU.AdminPanel.csproj +++ b/src/AdminPanel/MUnique.OpenMU.AdminPanel.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -53,9 +53,9 @@ - + - + all @@ -68,7 +68,7 @@ The CI environment is identified by the parameter 'ci'. It's set in the azure pipelines and Dockerfile. If you run into errors here under Linux/Mac OS, it might help to add this parameter, too. --> - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/AttributeSystem/MUnique.OpenMU.AttributeSystem.csproj b/src/AttributeSystem/MUnique.OpenMU.AttributeSystem.csproj index b9c42411c..344fec963 100644 --- a/src/AttributeSystem/MUnique.OpenMU.AttributeSystem.csproj +++ b/src/AttributeSystem/MUnique.OpenMU.AttributeSystem.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 enable nullable false diff --git a/src/ChatServer/ExDbConnector/MUnique.OpenMU.ChatServer.ExDbConnector.csproj b/src/ChatServer/ExDbConnector/MUnique.OpenMU.ChatServer.ExDbConnector.csproj index 3e39cd325..fe2b0e771 100644 --- a/src/ChatServer/ExDbConnector/MUnique.OpenMU.ChatServer.ExDbConnector.csproj +++ b/src/ChatServer/ExDbConnector/MUnique.OpenMU.ChatServer.ExDbConnector.csproj @@ -1,7 +1,7 @@  Exe - net5.0 + net6.0 enable nullable false diff --git a/src/ChatServer/MUnique.OpenMU.ChatServer.csproj b/src/ChatServer/MUnique.OpenMU.ChatServer.csproj index d8154aa7c..06f1d6c0b 100644 --- a/src/ChatServer/MUnique.OpenMU.ChatServer.csproj +++ b/src/ChatServer/MUnique.OpenMU.ChatServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/ClientLauncher/MUnique.OpenMU.ClientLauncher.csproj b/src/ClientLauncher/MUnique.OpenMU.ClientLauncher.csproj index 9863e9502..6c84c9599 100644 --- a/src/ClientLauncher/MUnique.OpenMU.ClientLauncher.csproj +++ b/src/ClientLauncher/MUnique.OpenMU.ClientLauncher.csproj @@ -1,7 +1,7 @@  WinExe - net5.0-windows + net6.0-windows true enable nullable diff --git a/src/ConnectServer/MUnique.OpenMU.ConnectServer.csproj b/src/ConnectServer/MUnique.OpenMU.ConnectServer.csproj index 9295ca95a..0a11d298f 100644 --- a/src/ConnectServer/MUnique.OpenMU.ConnectServer.csproj +++ b/src/ConnectServer/MUnique.OpenMU.ConnectServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/DataModel/MUnique.OpenMU.DataModel.csproj b/src/DataModel/MUnique.OpenMU.DataModel.csproj index 29989a023..e5bcd9678 100644 --- a/src/DataModel/MUnique.OpenMU.DataModel.csproj +++ b/src/DataModel/MUnique.OpenMU.DataModel.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 enable nullable false @@ -31,7 +30,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/src/FriendServer/MUnique.OpenMU.FriendServer.csproj b/src/FriendServer/MUnique.OpenMU.FriendServer.csproj index 3daac1e5b..347b95b7f 100644 --- a/src/FriendServer/MUnique.OpenMU.FriendServer.csproj +++ b/src/FriendServer/MUnique.OpenMU.FriendServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/GameLogic/MUnique.OpenMU.GameLogic.csproj b/src/GameLogic/MUnique.OpenMU.GameLogic.csproj index 25296f3fc..69c32d429 100644 --- a/src/GameLogic/MUnique.OpenMU.GameLogic.csproj +++ b/src/GameLogic/MUnique.OpenMU.GameLogic.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 enable nullable false @@ -29,7 +28,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/src/GameLogic/PoisonMagicEffect.cs b/src/GameLogic/PoisonMagicEffect.cs index 12f11a633..1eefe6f41 100644 --- a/src/GameLogic/PoisonMagicEffect.cs +++ b/src/GameLogic/PoisonMagicEffect.cs @@ -54,7 +54,7 @@ protected override void Dispose(bool disposing) this.damageTimer.Dispose(); } - private void OnDamageTimerElapsed(object sender, ElapsedEventArgs e) + private void OnDamageTimerElapsed(object? sender, ElapsedEventArgs e) { try { diff --git a/src/GameServer/MUnique.OpenMU.GameServer.csproj b/src/GameServer/MUnique.OpenMU.GameServer.csproj index 494f0dd27..b591528c8 100644 --- a/src/GameServer/MUnique.OpenMU.GameServer.csproj +++ b/src/GameServer/MUnique.OpenMU.GameServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/GuildServer/MUnique.OpenMU.GuildServer.csproj b/src/GuildServer/MUnique.OpenMU.GuildServer.csproj index 025673681..fd8966c54 100644 --- a/src/GuildServer/MUnique.OpenMU.GuildServer.csproj +++ b/src/GuildServer/MUnique.OpenMU.GuildServer.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable nullable false diff --git a/src/Interfaces/MUnique.OpenMU.Interfaces.csproj b/src/Interfaces/MUnique.OpenMU.Interfaces.csproj index 57bff930f..3f54692a5 100644 --- a/src/Interfaces/MUnique.OpenMU.Interfaces.csproj +++ b/src/Interfaces/MUnique.OpenMU.Interfaces.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 false false enable @@ -27,7 +26,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/src/LoginServer/MUnique.OpenMU.LoginServer.csproj b/src/LoginServer/MUnique.OpenMU.LoginServer.csproj index af9d64393..b62eedab2 100644 --- a/src/LoginServer/MUnique.OpenMU.LoginServer.csproj +++ b/src/LoginServer/MUnique.OpenMU.LoginServer.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/Network/Analyzer/MUnique.OpenMU.Network.Analyzer.csproj b/src/Network/Analyzer/MUnique.OpenMU.Network.Analyzer.csproj index 7b3043045..7c97c52d9 100644 --- a/src/Network/Analyzer/MUnique.OpenMU.Network.Analyzer.csproj +++ b/src/Network/Analyzer/MUnique.OpenMU.Network.Analyzer.csproj @@ -1,7 +1,7 @@  WinExe - net5.0-windows + net6.0-windows true enable nullable @@ -38,7 +38,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Network/Analyzer/MainForm.cs b/src/Network/Analyzer/MainForm.cs index 43e4d23b6..bcda3670c 100644 --- a/src/Network/Analyzer/MainForm.cs +++ b/src/Network/Analyzer/MainForm.cs @@ -229,7 +229,7 @@ private void SetPacketDataSource() } } - private void OnUnfilteredListChanged(object sender, ListChangedEventArgs e) + private void OnUnfilteredListChanged(object? sender, ListChangedEventArgs e) { if (e.ListChangedType != ListChangedType.ItemAdded || this.filterMethod is not { } filter diff --git a/src/Network/MUnique.OpenMU.Network.csproj b/src/Network/MUnique.OpenMU.Network.csproj index 9bd5e2a2a..165008b0c 100644 --- a/src/Network/MUnique.OpenMU.Network.csproj +++ b/src/Network/MUnique.OpenMU.Network.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 enable nullable false @@ -51,13 +50,13 @@ - + all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Network/Packets/MUnique.OpenMU.Network.Packets.csproj b/src/Network/Packets/MUnique.OpenMU.Network.Packets.csproj index 1944ddacf..3ff7ff71a 100644 --- a/src/Network/Packets/MUnique.OpenMU.Network.Packets.csproj +++ b/src/Network/Packets/MUnique.OpenMU.Network.Packets.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 false false false diff --git a/src/Pathfinding/MUnique.OpenMU.Pathfinding.csproj b/src/Pathfinding/MUnique.OpenMU.Pathfinding.csproj index 804338c19..07c63cd92 100644 --- a/src/Pathfinding/MUnique.OpenMU.Pathfinding.csproj +++ b/src/Pathfinding/MUnique.OpenMU.Pathfinding.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable nullable false diff --git a/src/Persistence/EntityFramework/EntityDataContext.cs b/src/Persistence/EntityFramework/EntityDataContext.cs index fae4e00c8..5a1ea2e2f 100644 --- a/src/Persistence/EntityFramework/EntityDataContext.cs +++ b/src/Persistence/EntityFramework/EntityDataContext.cs @@ -66,7 +66,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) { entity.Property(character => character.Name).HasMaxLength(10).IsRequired(); entity.HasIndex(character => character.Name).IsUnique(); - entity.Metadata.FindNavigation(nameof(Character.RawCharacterClass)).ForeignKey.IsRequired = true; + entity.Metadata.FindNavigation(nameof(Character.RawCharacterClass))!.ForeignKey.IsRequired = true; entity.Property(character => character.CharacterSlot).IsRequired(); entity.Property(character => character.CreateDate).HasDefaultValueSql("CURRENT_TIMESTAMP"); var accountKey = entity.Metadata.GetForeignKeys().First(key => key.PrincipalEntityType == modelBuilder.Entity().Metadata); diff --git a/src/Persistence/EntityFramework/GameServerDefinitionRepository.cs b/src/Persistence/EntityFramework/GameServerDefinitionRepository.cs index 2f1de8e6a..52ab524d2 100644 --- a/src/Persistence/EntityFramework/GameServerDefinitionRepository.cs +++ b/src/Persistence/EntityFramework/GameServerDefinitionRepository.cs @@ -32,9 +32,9 @@ protected override void LoadDependentData(object obj, DbContext currentContext) if (obj is GameServerDefinition definition) { var entityEntry = currentContext.Entry(obj); - foreach (var collection in entityEntry.Collections.Where(c => !c.IsLoaded && c.Metadata is IConventionNavigation)) + foreach (var collection in entityEntry.Collections.Where(c => !c.IsLoaded && c.Metadata is INavigation)) { - this.LoadCollection(entityEntry, (IConventionNavigation)collection.Metadata, currentContext); + this.LoadCollection(entityEntry, (INavigation)collection.Metadata, currentContext); collection.IsLoaded = true; } diff --git a/src/Persistence/EntityFramework/GenericRepositoryBase.cs b/src/Persistence/EntityFramework/GenericRepositoryBase.cs index dc1c3319e..65d86cf15 100644 --- a/src/Persistence/EntityFramework/GenericRepositoryBase.cs +++ b/src/Persistence/EntityFramework/GenericRepositoryBase.cs @@ -34,7 +34,7 @@ protected GenericRepositoryBase(RepositoryManager repositoryManager, ILogger log this.logger = logger; this.RepositoryManager = repositoryManager; using var completeContext = new EntityDataContext(); - this.FullEntityType = completeContext.Model.FindEntityType(typeof(T)); + this.FullEntityType = completeContext.Model.FindEntityType(typeof(T)) ?? throw new InvalidOperationException($"{typeof(T)} is not included in the model"); } /// @@ -99,7 +99,7 @@ public virtual IEnumerable GetAll() } /// - public IEnumerable LoadByProperty(IConventionProperty property, object propertyValue) + public IEnumerable LoadByProperty(IProperty property, object propertyValue) { using var context = this.GetContext(); var result = this.LoadByPropertyInternal(property, propertyValue, context.Context).OfType().ToList(); @@ -127,11 +127,11 @@ protected virtual void LoadDependentData(object obj, DbContext currentContext) { var entityEntry = currentContext.Entry(obj); - foreach (var navigation in this.GetNavigations(entityEntry).OfType()) + foreach (var navigation in this.GetNavigations(entityEntry).OfType()) { if (!navigation.IsCollection) { - if (this.FullEntityType.FindPrimaryKey().Properties[0] == navigation.ForeignKey.Properties[0]) + if (this.FullEntityType.FindPrimaryKey()?.Properties[0] == navigation.ForeignKey.Properties[0]) { // The entity type is a many-to-many join entity and the property of the navigation is the "owner" of it. // Therefore, we don't need to load it. It would be nice to set the object reference somehow, though. @@ -145,7 +145,7 @@ protected virtual void LoadDependentData(object obj, DbContext currentContext) foreach (var collection in entityEntry.Collections.Where(c => !c.IsLoaded)) { - if (collection.Metadata is IConventionNavigation metadata) + if (collection.Metadata is INavigation metadata) { this.LoadCollection(entityEntry, metadata, currentContext); collection.IsLoaded = true; @@ -172,17 +172,17 @@ protected virtual void LoadDependentData(IEnumerable loadedObjects, DbContext cu /// The entity entry. /// The navigation. /// The context. - protected virtual void LoadCollection(EntityEntry entityEntry, IConventionNavigation navigation, DbContext context) + protected virtual void LoadCollection(EntityEntry entityEntry, INavigation navigation, DbContext context) { var foreignKeyProperty = navigation.ForeignKey.Properties[0]; - var loadStatusAware = navigation.GetGetter().GetClrValue(entityEntry.Entity) as ILoadingStatusAwareList; + var loadStatusAware = navigation.GetClrValue(entityEntry.Entity); if (loadStatusAware?.LoadingStatus == LoadingStatus.Loaded || loadStatusAware?.LoadingStatus == LoadingStatus.Loading) { // already loaded or loading return; } - if (loadStatusAware is null && navigation.GetGetter().GetClrValue(entityEntry.Entity) != null) + if (loadStatusAware is null && navigation.GetClrValue(entityEntry.Entity) != null) { // already loaded or loading return; @@ -198,12 +198,15 @@ protected virtual void LoadCollection(EntityEntry entityEntry, IConventionNaviga if (this.RepositoryManager.GetRepository(foreignKeyProperty.DeclaringEntityType.ClrType) is ILoadByProperty repository) { var foreignKeyValue = entityEntry.Property(navigation.ForeignKey.PrincipalKey.Properties[0].Name).CurrentValue; - var items = repository.LoadByProperty(foreignKeyProperty, foreignKeyValue); - foreach (var obj in items) + if (foreignKeyValue is { }) { - if (!loadStatusAware.Contains(obj)) + var items = repository.LoadByProperty(foreignKeyProperty, foreignKeyValue); + foreach (var obj in items) { - loadStatusAware.Add(obj); + if (!loadStatusAware.Contains(obj)) + { + loadStatusAware.Add(obj); + } } } @@ -221,7 +224,7 @@ protected virtual void LoadCollection(EntityEntry entityEntry, IConventionNaviga /// /// The entity entry from the context. /// The navigation property. - protected virtual void LoadNavigationProperty(EntityEntry entityEntry, IConventionNavigation navigation) + protected virtual void LoadNavigationProperty(EntityEntry entityEntry, IReadOnlyNavigation navigation) { if (navigation.ForeignKey.DeclaringEntityType != navigation.DeclaringEntityType) { @@ -235,8 +238,7 @@ protected virtual void LoadNavigationProperty(EntityEntry entityEntry, IConventi Guid id = (idValue as Guid?) ?? Guid.Empty; if (id != Guid.Empty) { - var getter = navigation.GetGetter(); - var currentValue = getter.GetClrValue(entityEntry.Entity); + var currentValue = navigation.GetClrValue(entityEntry.Entity); if (currentValue is IIdentifiable identifiable && identifiable.Id == id) { // loaded already @@ -255,16 +257,10 @@ protected virtual void LoadNavigationProperty(EntityEntry entityEntry, IConventi if (repository != null) { -#pragma warning disable EF1001 // Internal EF Core API usage. - if (navigation is Navigation { Setter: { } } concreteNavigation) - { - concreteNavigation.Setter.SetClrValue(entityEntry.Entity, repository.GetById(id)); - } - else + if (!navigation.TrySetClrValue(entityEntry.Entity, repository.GetById(id))) { this.logger.LogError($"Could not find setter for navigation {navigation}"); } -#pragma warning restore EF1001 // Internal EF Core API usage. } else { @@ -279,7 +275,7 @@ protected virtual void LoadNavigationProperty(EntityEntry entityEntry, IConventi /// The context. protected abstract EntityFrameworkContextBase GetContext(); - private IEnumerable LoadByPropertyInternal(IConventionProperty property, object propertyValue, DbContext context) + private IEnumerable LoadByPropertyInternal(IProperty property, object propertyValue, DbContext context) { if (property.ClrType == typeof(Guid)) { diff --git a/src/Persistence/EntityFramework/ILoadByProperty.cs b/src/Persistence/EntityFramework/ILoadByProperty.cs index 1729dc695..05261af99 100644 --- a/src/Persistence/EntityFramework/ILoadByProperty.cs +++ b/src/Persistence/EntityFramework/ILoadByProperty.cs @@ -18,6 +18,6 @@ internal interface ILoadByProperty /// The property of the object which should be compared. /// The value of the property. /// The enumeration of the loaded objects. - IEnumerable LoadByProperty(IConventionProperty property, object propertyValue); + IEnumerable LoadByProperty(IProperty property, object propertyValue); } } diff --git a/src/Persistence/EntityFramework/Json/JsonObjectLoader.cs b/src/Persistence/EntityFramework/Json/JsonObjectLoader.cs index 5f66f0b0e..64f96d8be 100644 --- a/src/Persistence/EntityFramework/Json/JsonObjectLoader.cs +++ b/src/Persistence/EntityFramework/Json/JsonObjectLoader.cs @@ -44,7 +44,7 @@ public IEnumerable LoadAllObjects(DbContext context) where T : class, IIdentifiable { var result = new List(); - var type = context.Model.FindEntityType(typeof(T)); + var type = context.Model.FindEntityType(typeof(T)) ?? throw new ArgumentException($"{typeof(T)} is not included in the model of the context."); var queryString = this.queryBuilder.BuildJsonQueryForEntity(type); using var command = context.Database.GetDbConnection().CreateCommand(); command.CommandText = queryString; @@ -77,7 +77,7 @@ public IEnumerable LoadAllObjects(DbContext context) IEntityType type; using (var completeContext = new EntityDataContext()) { - type = completeContext.Model.FindEntityType(typeof(T)); + type = completeContext.Model.FindEntityType(typeof(T)) ?? throw new ArgumentException($"{typeof(T)} is not included in the model of the context."); } var queryString = this.queryBuilder.BuildJsonQueryForEntity(type); diff --git a/src/Persistence/EntityFramework/Json/JsonQueryBuilder.cs b/src/Persistence/EntityFramework/Json/JsonQueryBuilder.cs index 36e4ac37d..af3dcafec 100644 --- a/src/Persistence/EntityFramework/Json/JsonQueryBuilder.cs +++ b/src/Persistence/EntityFramework/Json/JsonQueryBuilder.cs @@ -4,6 +4,7 @@ namespace MUnique.OpenMU.Persistence.EntityFramework.Json { + using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; @@ -138,8 +139,7 @@ private void AddNavigation(INavigation navigation, StringBuilder stringBuilder, { stringBuilder.Append("select row_to_json(").Append(navigationAlias).Append(") from ("); this.AddTypeToQuery(targetType, stringBuilder, navigationAlias); - var primaryKey = targetType.FindPrimaryKey().Properties[0]; - stringBuilder.Append(") ").Append(navigationAlias).Append(" where ").Append(navigationAlias).Append(".\"").Append(primaryKey.GetColumnName()).Append("\" = ").Append(parentAlias).Append(".\"").Append(foreignKey.Name).AppendLine("\""); + stringBuilder.Append(") ").Append(navigationAlias).Append(" where ").Append(navigationAlias).Append(".\"").Append(targetType.GetPrimaryKeyColumnName()).Append("\" = ").Append(parentAlias).Append(".\"").Append(foreignKey.Name).AppendLine("\""); } stringBuilder.Append(") as \"").Append(navigation.Name).AppendLine("\""); @@ -149,9 +149,14 @@ private void AddCollection(INavigation navigation, IEntityType entityType, Strin { var keyProperty = navigation.ForeignKey.Properties[0]; var navigationType = keyProperty.DeclaringEntityType; - #pragma warning disable EF1001 // Internal EF Core API usage. - if (navigationType.FindDeclaredPrimaryKey().Properties.Count > 1) + if (navigationType.FindDeclaredPrimaryKey() is not { } primaryKey) + { + return; + } +#pragma warning restore EF1001 // Internal EF Core API usage. + + if (primaryKey.Properties.Count > 1) { this.AddManyToManyCollection(navigationType, entityType, stringBuilder, parentAlias, keyProperty); } @@ -159,17 +164,16 @@ private void AddCollection(INavigation navigation, IEntityType entityType, Strin { this.AddOneToManyCollection(navigation, navigationType, stringBuilder, parentAlias, keyProperty); } -#pragma warning restore EF1001 // Internal EF Core API usage. stringBuilder.Append(") as \"").Append(navigation.Name.Replace("Joined", string.Empty)).AppendLine("\""); } private void AddOneToManyCollection(INavigation navigation, IEntityType navigationType, StringBuilder stringBuilder, string parentAlias, IProperty keyProperty) { + var primaryKeyName = navigationType.GetDeclaredPrimaryKeyColumnName(); + var navigationAlias = this.GetNextAlias(parentAlias); -#pragma warning disable EF1001 // Internal EF Core API usage. - var primaryKeyName = navigationType.FindDeclaredPrimaryKey().Properties[0].GetColumnName(); -#pragma warning restore EF1001 // Internal EF Core API usage. + stringBuilder.AppendLine(", (") .Append("select array_to_json(array_agg(row_to_json(").Append(navigationAlias).AppendLine("))) from ("); @@ -181,8 +185,8 @@ private void AddOneToManyCollection(INavigation navigation, IEntityType navigati } else { - var primaryKeyProperty = navigationType.FindPrimaryKey().Properties[0]; // It's always one property, usually called "Id" - stringBuilder.Append("select \"").Append(primaryKeyProperty.GetColumnName()).AppendLine("\" as \"$ref\""); + var primaryKeyColumnName = navigationType.GetPrimaryKeyColumnName(); // It's always one property, usually called "Id" + stringBuilder.Append("select \"").Append(primaryKeyColumnName).AppendLine("\" as \"$ref\""); stringBuilder.Append("from ").Append(navigationType.GetSchema()).Append(".\"").Append(navigationType.GetTableName()).AppendLine("\" ") .Append("where \"").Append(keyProperty.Name).Append("\" = ").Append(parentAlias).Append(".\"").Append(primaryKeyName).AppendLine("\"") .Append(") as ").AppendLine(navigationAlias); @@ -205,10 +209,11 @@ private void AddOneToManyCollection(INavigation navigation, IEntityType navigati private void AddManyToManyCollection(IEntityType navigationType, IEntityType entityType, StringBuilder stringBuilder, string parentAlias, IProperty keyProperty) { var navigationAlias = this.GetNextAlias(parentAlias); - var entityTypePrimaryKeyName = entityType.FindPrimaryKey().Properties[0].GetColumnName(); // usually "Id" + var entityTypePrimaryKeyName = entityType.GetPrimaryKeyColumnName(); // usually "Id" var otherEntityTypeForeignKey = navigationType.GetForeignKeys().FirstOrDefault(fk => fk.PrincipalEntityType != entityType); var otherEntityTypeKey = navigationType.GetKeys().FirstOrDefault(fk => fk.DeclaringEntityType != entityType); - var referenceColumnToOtherEntity = otherEntityTypeForeignKey?.Properties[0].GetColumnName() ?? otherEntityTypeKey?.Properties[0].GetColumnName(); + var referenceColumnToOtherEntity = otherEntityTypeForeignKey?.GetColumnName() ?? otherEntityTypeKey?.GetColumnName() + ?? throw new InvalidOperationException("No reference column available."); stringBuilder.AppendLine(", (") .Append("select array_to_json(array_agg(row_to_json(").Append(navigationAlias).AppendLine("))) from ("); diff --git a/src/Persistence/EntityFramework/MUnique.OpenMU.Persistence.EntityFramework.csproj b/src/Persistence/EntityFramework/MUnique.OpenMU.Persistence.EntityFramework.csproj index b02a1505c..80319e18e 100644 --- a/src/Persistence/EntityFramework/MUnique.OpenMU.Persistence.EntityFramework.csproj +++ b/src/Persistence/EntityFramework/MUnique.OpenMU.Persistence.EntityFramework.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -28,14 +28,14 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + all runtime; build; native; contentfiles; analyzers diff --git a/src/Persistence/EntityFramework/ModelExtensions.cs b/src/Persistence/EntityFramework/ModelExtensions.cs new file mode 100644 index 000000000..56400977a --- /dev/null +++ b/src/Persistence/EntityFramework/ModelExtensions.cs @@ -0,0 +1,177 @@ +// +// Licensed under the MIT License. See LICENSE file in the project root for full license information. +// + +namespace MUnique.OpenMU.Persistence.EntityFramework +{ + using System; + using System.Linq; + using System.Reflection; + using Microsoft.EntityFrameworkCore; + using Microsoft.EntityFrameworkCore.Metadata; + using Microsoft.EntityFrameworkCore.Metadata.Internal; + using MUnique.OpenMU.DataModel.Composition; + + /// + /// Extensions for s. + /// + public static class ModelExtensions + { + /// + /// Determines whether the specified navigation is a member of the aggregate. + /// + /// The navigation. + /// + /// true if the specified navigation is a member of the aggregate; otherwise, false. + /// + internal static bool IsMemberOfAggregate(this IReadOnlyNavigationBase navigation) + { + var propertyInfo = navigation.PropertyInfo; + if (propertyInfo?.Name.StartsWith("Raw") ?? false) + { + propertyInfo = propertyInfo.DeclaringType?.GetProperty(propertyInfo.Name.Substring(3), BindingFlags.Instance | BindingFlags.Public); + } + + return propertyInfo?.GetCustomAttribute() is { }; + } + + /// + /// Gets the value of a navigation property of an entity. + /// + /// The navigation. + /// The entity. + /// The value of the navigation property. + internal static object? GetClrValue(this IReadOnlyNavigation navigation, object entity) + { + return navigation.GetClrValue(entity); + } + + /// + /// Gets the value of a navigation property of an entity. + /// + /// The navigation. + /// The entity. + /// The value of the navigation property. + /// The expected type of the result. + internal static T? GetClrValue(this IReadOnlyNavigation navigation, object entity) + where T : class + { + return navigation.PropertyInfo?.GetMethod?.Invoke(entity, Array.Empty()) as T; + } + + /// + /// Gets the value of a navigation property of an entity. + /// + /// The navigation. + /// The entity. + /// The value which should be set at the navigation property. + /// The success of the operation. Fails, when there is no available setter. + internal static bool TrySetClrValue(this IReadOnlyNavigation navigation, object entity, object? value) + { + if (navigation.PropertyInfo?.SetMethod is { } setMethod) + { + setMethod.Invoke(entity, new[] { value }); + return true; + } + + return false; + } + + /// + /// Gets the column name of the declared primary key. + /// When you have a 1:n-relationship, it's the primary key of the '1', where is the 'n'. + /// Only works for single-column primary keys. + /// + /// The entity type of 'n' in a 1:n-relationship. + /// The column name of the declared primary key. + internal static string GetDeclaredPrimaryKeyColumnName(this IEntityType entityType) + { +#pragma warning disable EF1001 // Internal EF Core API usage. + if (entityType.FindDeclaredPrimaryKey() is not { } primaryKey) +#pragma warning restore EF1001 // Internal EF Core API usage. + { + throw new ArgumentException($"Entity type {entityType} has no declared primary key."); + } + + return primaryKey.GetColumnName(); + } + + /// + /// Gets the column name of the primary key. + /// Only works for single-column primary keys. + /// + /// The entity type. + /// The column name of the primary key. + internal static string GetPrimaryKeyColumnName(this IEntityType entityType) + { + if (entityType.FindPrimaryKey() is not { } primaryKey) + { + throw new ArgumentException($"Entity type {entityType} has no primary key."); + } + + return primaryKey.GetColumnName(); + } + + /// + /// Gets the column name for a foreign key. + /// Only works for single-column foreign key. + /// + /// The foreign key. + /// The column name for a foreign key. + internal static string GetColumnName(this IReadOnlyForeignKey foreignKey) + { + if (foreignKey.Properties.Count > 1) + { + throw new ArgumentException("Can't return a column name for a composite foreign key.", nameof(foreignKey)); + } + + if (foreignKey.Properties.SingleOrDefault() is not { } keyProperty) + { + throw new ArgumentException($"Key {foreignKey} has no properties", nameof(foreignKey)); + } + + return keyProperty.GetColumnName(); + } + + /// + /// Gets the column name for a key. + /// Only works for single-column key. + /// + /// The key. + /// The column name for a key. + internal static string GetColumnName(this IReadOnlyKey key) + { + if (key.Properties.Count > 1) + { + throw new ArgumentException("Can't return a column name for a composite primary key.", nameof(key)); + } + + if (key.Properties.SingleOrDefault() is not { } keyProperty) + { + throw new ArgumentException($"Key {key} has no properties", nameof(key)); + } + + return keyProperty.GetColumnName(); + } + + /// + /// Gets the column name for a property. + /// + /// The property. + /// The column name for a property. + internal static string GetColumnName(this IReadOnlyProperty property) + { + if (StoreObjectIdentifier.Create(property.DeclaringEntityType, StoreObjectType.Table) is not { } keyIdentifier) + { + throw new InvalidOperationException($"Couldn't create a {nameof(StoreObjectIdentifier)} for declaring entity type {property.DeclaringEntityType} of property {property}."); + } + + if (property.GetDefaultColumnName(keyIdentifier) is not { } columnName) + { + throw new InvalidOperationException($"Found no column name for {keyIdentifier}."); + } + + return columnName; + } + } +} diff --git a/src/Persistence/EntityFramework/MyNpgsqlMigrationsSqlGenerator.cs b/src/Persistence/EntityFramework/MyNpgsqlMigrationsSqlGenerator.cs index 5c8a8c96d..d4709a8ef 100644 --- a/src/Persistence/EntityFramework/MyNpgsqlMigrationsSqlGenerator.cs +++ b/src/Persistence/EntityFramework/MyNpgsqlMigrationsSqlGenerator.cs @@ -79,7 +79,7 @@ public MyNpgsqlMigrationsSqlGenerator(MigrationsSqlGeneratorDependencies depende /// The operation. /// The target model which may be if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(EnsureSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) + protected override void Generate(EnsureSchemaOperation operation, IModel? model, MigrationCommandListBuilder builder) { base.Generate(operation, model, builder); var schemaName = operation.Name; @@ -108,7 +108,7 @@ protected override void Generate(EnsureSchemaOperation operation, IModel model, /// The operation. /// The target model which may be if the operations exist without a model. /// The command builder to use to build the commands. - protected override void Generate(DropSchemaOperation operation, IModel model, MigrationCommandListBuilder builder) + protected override void Generate(DropSchemaOperation operation, IModel? model, MigrationCommandListBuilder builder) { base.Generate(operation, model, builder); var schemaName = operation.Name; @@ -130,7 +130,7 @@ protected override void Generate(DropSchemaOperation operation, IModel model, Mi /// The target model which may be if the operations exist without a model. /// The command builder to use to build the commands. /// Indicates whether or not to terminate the command after generating SQL for the operation. - protected override void Generate(CreateTableOperation operation, IModel model, MigrationCommandListBuilder builder, bool terminate = true) + protected override void Generate(CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true) { base.Generate(operation, model, builder, terminate); if (operation.Schema != "data") diff --git a/src/Persistence/EntityFramework/NavigationExtensions.cs b/src/Persistence/EntityFramework/NavigationExtensions.cs deleted file mode 100644 index b812f276d..000000000 --- a/src/Persistence/EntityFramework/NavigationExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -// -// Licensed under the MIT License. See LICENSE file in the project root for full license information. -// - -namespace MUnique.OpenMU.Persistence.EntityFramework -{ - using System.Reflection; - using Microsoft.EntityFrameworkCore.Metadata; - using MUnique.OpenMU.DataModel.Composition; - - /// - /// Extensions for s. - /// - public static class NavigationExtensions - { - /// - /// Determines whether the specified navigation is a member of the aggregate. - /// - /// The navigation. - /// - /// true if the specified navigation is a member of the aggregate; otherwise, false. - /// - public static bool IsMemberOfAggregate(this INavigation navigation) - { - var propertyInfo = navigation.PropertyInfo; - if (propertyInfo.Name.StartsWith("Raw")) - { - propertyInfo = propertyInfo.DeclaringType?.GetProperty(propertyInfo.Name.Substring(3), BindingFlags.Instance | BindingFlags.Public); - } - - return propertyInfo?.GetCustomAttribute() is { }; - } - } -} diff --git a/src/Persistence/EntityFramework/TypedContext{T}.cs b/src/Persistence/EntityFramework/TypedContext{T}.cs index 09cdbd992..9aa5200a6 100644 --- a/src/Persistence/EntityFramework/TypedContext{T}.cs +++ b/src/Persistence/EntityFramework/TypedContext{T}.cs @@ -60,7 +60,7 @@ private IEnumerable DetermineNavigationTypes(IMutableEntityT { yield return navigation.TargetEntityType; - if (navigation.IsMemberOfAggregate() || navigation.PropertyInfo.Name.StartsWith("Joined")) + if (navigation.IsMemberOfAggregate() || (navigation.PropertyInfo?.Name.StartsWith("Joined") ?? false)) { foreach (var navEditType in this.DetermineNavigationTypes(navigation.TargetEntityType)) { diff --git a/src/Persistence/InMemory/MUnique.OpenMU.Persistence.InMemory.csproj b/src/Persistence/InMemory/MUnique.OpenMU.Persistence.InMemory.csproj index 1efe79e2d..2262a2cfe 100644 --- a/src/Persistence/InMemory/MUnique.OpenMU.Persistence.InMemory.csproj +++ b/src/Persistence/InMemory/MUnique.OpenMU.Persistence.InMemory.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 enable nullable false diff --git a/src/Persistence/Initialization/MUnique.OpenMU.Persistence.Initialization.csproj b/src/Persistence/Initialization/MUnique.OpenMU.Persistence.Initialization.csproj index 27a61b2dd..c323d7f97 100644 --- a/src/Persistence/Initialization/MUnique.OpenMU.Persistence.Initialization.csproj +++ b/src/Persistence/Initialization/MUnique.OpenMU.Persistence.Initialization.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false diff --git a/src/Persistence/MUnique.OpenMU.Persistence.csproj b/src/Persistence/MUnique.OpenMU.Persistence.csproj index a8c882342..1580f81cd 100644 --- a/src/Persistence/MUnique.OpenMU.Persistence.csproj +++ b/src/Persistence/MUnique.OpenMU.Persistence.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 false false enable @@ -45,7 +45,7 @@ all runtime; build; native; contentfiles; analyzers - + diff --git a/src/Persistence/RepositoryNotFoundException.cs b/src/Persistence/RepositoryNotFoundException.cs index 895026db4..c12d90de3 100644 --- a/src/Persistence/RepositoryNotFoundException.cs +++ b/src/Persistence/RepositoryNotFoundException.cs @@ -7,7 +7,7 @@ namespace MUnique.OpenMU.Persistence using System; /// - /// Desctiption of RepositoryNotFoundException. + /// Description of RepositoryNotFoundException. /// [Serializable] public class RepositoryNotFoundException : Exception diff --git a/src/Persistence/SourceGenerator/MUnique - Backup.OpenMU.Persistence.SourceGenerator.csproj b/src/Persistence/SourceGenerator/MUnique - Backup.OpenMU.Persistence.SourceGenerator.csproj deleted file mode 100644 index f2a32109d..000000000 --- a/src/Persistence/SourceGenerator/MUnique - Backup.OpenMU.Persistence.SourceGenerator.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - Exe - net5.0 - 9.0 - false - warnings - MUnique.OpenMU.Persistence.SourceGenerator.xml - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - - - - - - - - - diff --git a/src/Persistence/SourceGenerator/MUnique.OpenMU.Persistence.SourceGenerator.csproj b/src/Persistence/SourceGenerator/MUnique.OpenMU.Persistence.SourceGenerator.csproj index e882c42ca..28ef1b9e5 100644 --- a/src/Persistence/SourceGenerator/MUnique.OpenMU.Persistence.SourceGenerator.csproj +++ b/src/Persistence/SourceGenerator/MUnique.OpenMU.Persistence.SourceGenerator.csproj @@ -2,8 +2,7 @@ Exe - net5.0 - 9.0 + net6.0 false false warnings @@ -12,8 +11,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/src/Persistence/SourceGenerator/Program.cs b/src/Persistence/SourceGenerator/Program.cs index 02f88d02b..fabeea125 100644 --- a/src/Persistence/SourceGenerator/Program.cs +++ b/src/Persistence/SourceGenerator/Program.cs @@ -19,7 +19,7 @@ public static class Program /// - The target folder path for the generated code. /// /// The arguments. - public static void Main(params string[] args) + public static int Main(params string[] args) { Console.WriteLine("Started generator with these parameters:"); foreach (var arg in args) @@ -30,7 +30,7 @@ public static void Main(params string[] args) if (args.Length < 2) { Console.WriteLine("Can't generate code. Please add the project name and the target folder path as starting parameter."); - return; + return 1; } IUnboundSourceGenerator generator = args[0] switch @@ -43,7 +43,7 @@ public static void Main(params string[] args) if (generator is null) { Console.WriteLine($"No generator found for target assembly '{args[0]}'."); - return; + return 2; } var targetFolder = args[1]; @@ -59,6 +59,8 @@ public static void Main(params string[] args) Console.WriteLine($"Writing {filePath}"); File.WriteAllText(filePath, source); } + + return 0; } } } diff --git a/src/PlugIns/MUnique.OpenMU.PlugIns.csproj b/src/PlugIns/MUnique.OpenMU.PlugIns.csproj index 4d234bb94..0be9bf19c 100644 --- a/src/PlugIns/MUnique.OpenMU.PlugIns.csproj +++ b/src/PlugIns/MUnique.OpenMU.PlugIns.csproj @@ -1,8 +1,7 @@  - net5.0 - 9.0 + net6.0 enable nullable false @@ -40,9 +39,9 @@ - - - + + + all diff --git a/src/PublicApi/MUnique.OpenMU.PublicApi.csproj b/src/PublicApi/MUnique.OpenMU.PublicApi.csproj index fd8e18526..052439433 100644 --- a/src/PublicApi/MUnique.OpenMU.PublicApi.csproj +++ b/src/PublicApi/MUnique.OpenMU.PublicApi.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 false false enable diff --git a/src/PublicApi/appsettings.Development.json b/src/PublicApi/appsettings.Development.json deleted file mode 100644 index 8983e0fc1..000000000 --- a/src/PublicApi/appsettings.Development.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - } -} diff --git a/src/PublicApi/appsettings.json b/src/PublicApi/appsettings.json deleted file mode 100644 index d9d9a9bff..000000000 --- a/src/PublicApi/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information" - } - }, - "AllowedHosts": "*" -} diff --git a/src/SimpleModulusKeyGenerator/MUnique.OpenMU.SimpleModulusKeyGenerator.csproj b/src/SimpleModulusKeyGenerator/MUnique.OpenMU.SimpleModulusKeyGenerator.csproj index f7bd6ae71..0378e4160 100644 --- a/src/SimpleModulusKeyGenerator/MUnique.OpenMU.SimpleModulusKeyGenerator.csproj +++ b/src/SimpleModulusKeyGenerator/MUnique.OpenMU.SimpleModulusKeyGenerator.csproj @@ -3,7 +3,7 @@ Exe - net5.0 + net6.0 enable nullable false diff --git a/src/Startup/MUnique.OpenMU.Startup.csproj b/src/Startup/MUnique.OpenMU.Startup.csproj index 49f880962..4ef80a87d 100644 --- a/src/Startup/MUnique.OpenMU.Startup.csproj +++ b/src/Startup/MUnique.OpenMU.Startup.csproj @@ -3,7 +3,7 @@ Exe - net5.0 + net6.0 false false enable diff --git a/tests/MUnique.OpenMU.AttributeSystem.Tests/MUnique.OpenMU.AttributeSystem.Tests.csproj b/tests/MUnique.OpenMU.AttributeSystem.Tests/MUnique.OpenMU.AttributeSystem.Tests.csproj index 9d079b743..4e21ecaa6 100644 --- a/tests/MUnique.OpenMU.AttributeSystem.Tests/MUnique.OpenMU.AttributeSystem.Tests.csproj +++ b/tests/MUnique.OpenMU.AttributeSystem.Tests/MUnique.OpenMU.AttributeSystem.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -26,9 +26,9 @@ - + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.ChatServer.Tests/MUnique.OpenMU.ChatServer.Tests.csproj b/tests/MUnique.OpenMU.ChatServer.Tests/MUnique.OpenMU.ChatServer.Tests.csproj index 61843cc69..f5c1bc9ef 100644 --- a/tests/MUnique.OpenMU.ChatServer.Tests/MUnique.OpenMU.ChatServer.Tests.csproj +++ b/tests/MUnique.OpenMU.ChatServer.Tests/MUnique.OpenMU.ChatServer.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -26,10 +26,10 @@ - + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.Network.Benchmarks/MUnique.OpenMU.Network.Benchmarks.csproj b/tests/MUnique.OpenMU.Network.Benchmarks/MUnique.OpenMU.Network.Benchmarks.csproj index e011fa8e8..f6495dc5a 100644 --- a/tests/MUnique.OpenMU.Network.Benchmarks/MUnique.OpenMU.Network.Benchmarks.csproj +++ b/tests/MUnique.OpenMU.Network.Benchmarks/MUnique.OpenMU.Network.Benchmarks.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -31,7 +31,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.Network.Tests/MUnique.OpenMU.Network.Tests.csproj b/tests/MUnique.OpenMU.Network.Tests/MUnique.OpenMU.Network.Tests.csproj index 7266de467..f4cff76eb 100644 --- a/tests/MUnique.OpenMU.Network.Tests/MUnique.OpenMU.Network.Tests.csproj +++ b/tests/MUnique.OpenMU.Network.Tests/MUnique.OpenMU.Network.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -26,9 +26,9 @@ - + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.Pathfinding.Tests/MUnique.OpenMU.Pathfinding.Tests.csproj b/tests/MUnique.OpenMU.Pathfinding.Tests/MUnique.OpenMU.Pathfinding.Tests.csproj index 9d64198ad..952f342d3 100644 --- a/tests/MUnique.OpenMU.Pathfinding.Tests/MUnique.OpenMU.Pathfinding.Tests.csproj +++ b/tests/MUnique.OpenMU.Pathfinding.Tests/MUnique.OpenMU.Pathfinding.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -26,9 +26,9 @@ - + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.Persistence.Initialization.Tests/MUnique.OpenMU.Persistence.Initialization.Tests.csproj b/tests/MUnique.OpenMU.Persistence.Initialization.Tests/MUnique.OpenMU.Persistence.Initialization.Tests.csproj index 73291000b..042f88910 100644 --- a/tests/MUnique.OpenMU.Persistence.Initialization.Tests/MUnique.OpenMU.Persistence.Initialization.Tests.csproj +++ b/tests/MUnique.OpenMU.Persistence.Initialization.Tests/MUnique.OpenMU.Persistence.Initialization.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -32,9 +32,9 @@ - + - + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.PlugIns.Tests/MUnique.OpenMU.PlugIns.Tests.csproj b/tests/MUnique.OpenMU.PlugIns.Tests/MUnique.OpenMU.PlugIns.Tests.csproj index 4e341992d..c9dbbaf5c 100644 --- a/tests/MUnique.OpenMU.PlugIns.Tests/MUnique.OpenMU.PlugIns.Tests.csproj +++ b/tests/MUnique.OpenMU.PlugIns.Tests/MUnique.OpenMU.PlugIns.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -27,8 +27,8 @@ - - + + all runtime; build; native; contentfiles; analyzers diff --git a/tests/MUnique.OpenMU.Tests/MUnique.OpenMU.Tests.csproj b/tests/MUnique.OpenMU.Tests/MUnique.OpenMU.Tests.csproj index 1f4ae3206..5daa2faef 100644 --- a/tests/MUnique.OpenMU.Tests/MUnique.OpenMU.Tests.csproj +++ b/tests/MUnique.OpenMU.Tests/MUnique.OpenMU.Tests.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 enable nullable false @@ -26,10 +26,10 @@ - + - + all runtime; build; native; contentfiles; analyzers