From 07dc58913eee6d675c38a91ba02911959c8c821d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 20:59:36 +0000 Subject: [PATCH] Automated dotnet-format update --- .../Extensions/OpenApiExtensions.cs | 2 +- .../Models/ApplicationRole.cs | 4 ++-- .../Models/NexusModsApiKey.cs | 4 ++-- .../Models/NexusModsArticleId.cs | 2 +- .../Models/NexusModsGameDomain.cs | 4 ++-- .../Models/NexusModsModId.cs | 4 ++-- .../Models/NexusModsUserEMail.cs | 4 ++-- .../Models/NexusModsUserId.cs | 4 ++-- .../Models/NexusModsUserName.cs | 4 ++-- .../Models/TenantId.cs | 4 ++-- .../Usings.cs | 22 +++++++++++-------- .../Utils/IVogenParsable.cs | 2 +- .../Utils/IVogenSpanParsable.cs | 2 +- .../Utils/IVogenUtf8SpanParsable.cs | 2 +- .../Utils/VogenSchemaFilter.cs | 2 +- .../Utils/_QueryableHelper.cs | 2 +- .../Contexts/AppDbContextRead.cs | 2 +- .../Contexts/AppDbContextWrite.cs | 2 +- .../Configs/BaseEntityConfiguration.cs | 2 +- .../Contexts/Configs/IEntityConfiguration.cs | 2 +- .../Contexts/NpgsqlDataSourceProvider.cs | 8 +++---- .../CrashReportsAnalyzerController.cs | 2 +- src/BUTR.Site.NexusMods.Server/Startup.cs | 2 +- 23 files changed, 46 insertions(+), 42 deletions(-) diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Extensions/OpenApiExtensions.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Extensions/OpenApiExtensions.cs index bed7a276..d8575e74 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Extensions/OpenApiExtensions.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Extensions/OpenApiExtensions.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.Models; +namespace BUTR.Site.NexusMods.Server.Models; public static class OpenApiExtensions { diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs index 793cc740..3ec441ee 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs @@ -12,9 +12,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public static readonly TType User = From(ApplicationRoles.User); public static readonly TType Moderator = From(ApplicationRoles.Moderator); public static readonly TType Administrator = From(ApplicationRoles.Administrator); - + public static TType DefaultValue => Anonymous; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs index 90532842..5bb6698a 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs @@ -9,9 +9,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public readonly partial record struct NexusModsApiKey : IVogen, IHasDefaultValue { public static readonly TType None = From(string.Empty); - + public static NexusModsApiKey DefaultValue => None; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs index bb3dfde6..7c8f7382 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs @@ -11,7 +11,7 @@ namespace BUTR.Site.NexusMods.Server.Models; public static readonly TType None = From(0); public static TType DefaultValue => None; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs index 4cd2e46b..d3e9f483 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs @@ -12,7 +12,7 @@ namespace BUTR.Site.NexusMods.Server.Models; public static readonly TType Bannerlord = From(TenantUtils.BannerlordGameDomain); public static readonly TType Rimworld = From(TenantUtils.RimworldGameDomain); public static readonly TType StardewValley = From(TenantUtils.StardewValleyGameDomain); - + public static TType DefaultValue => None; public static IEnumerable Values @@ -24,7 +24,7 @@ public static IEnumerable Values yield return StardewValley; } } - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs index b26258b1..33005dfe 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs @@ -9,9 +9,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public readonly partial record struct NexusModsModId : IVogen, IVogenParsable, IVogenSpanParsable, IVogenUtf8SpanParsable { public static readonly TType None = From(0); - + public static TType DefaultValue => None; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs index 977294af..0f260ba5 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs @@ -9,9 +9,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public readonly partial record struct NexusModsUserEMail : IVogen, IHasDefaultValue { public static readonly TType Empty = From(string.Empty); - + public static TType DefaultValue => Empty; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs index d3fe12a1..178bef34 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs @@ -9,9 +9,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public readonly partial record struct NexusModsUserId : IVogen, IVogenParsable, IVogenSpanParsable, IVogenUtf8SpanParsable, IHasDefaultValue { public static readonly TType None = From(0); - + public static TType DefaultValue => None; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs index 6b277354..cae47a57 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs @@ -9,9 +9,9 @@ namespace BUTR.Site.NexusMods.Server.Models; public readonly partial record struct NexusModsUserName : IVogen, IHasDefaultValue { public static readonly TType Empty = From(string.Empty); - + public static TType DefaultValue => Empty; - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs index c6374edf..4a840637 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs @@ -12,7 +12,7 @@ namespace BUTR.Site.NexusMods.Server.Models; public static readonly TType Bannerlord = From(TenantUtils.BannerlordId); public static readonly TType Rimworld = From(TenantUtils.RimworldId); public static readonly TType StardewValley = From(TenantUtils.StardewValleyId); - + public static TType DefaultValue => None; public static IEnumerable Values @@ -25,7 +25,7 @@ public static IEnumerable Values //yield return DarkestDungeon; } } - + public static TType Copy(TType instance) => instance with { }; public static bool IsInitialized(TType instance) => instance._isInitialized; public static TType DeserializeDangerous(TValueType instance) => Deserialize(instance); diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Usings.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Usings.cs index bb0c8742..47ac59f2 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Usings.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Usings.cs @@ -1,20 +1,24 @@ -global using BUTR.Site.NexusMods.Shared.Helpers; global using BUTR.Site.NexusMods.Server.Models; -global using BUTR.Site.NexusMods.Server.ValueObjects.Utils; global using BUTR.Site.NexusMods.Server.Utils; -global using Microsoft.Extensions.DependencyInjection; +global using BUTR.Site.NexusMods.Server.ValueObjects.Utils; +global using BUTR.Site.NexusMods.Shared.Helpers; + global using Microsoft.EntityFrameworkCore; global using Microsoft.EntityFrameworkCore.ChangeTracking; -global using Microsoft.EntityFrameworkCore.Storage.ValueConversion; global using Microsoft.EntityFrameworkCore.Metadata.Builders; +global using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +global using Microsoft.Extensions.DependencyInjection; global using Microsoft.OpenApi.Models; -global using Vogen; + +global using Swashbuckle.AspNetCore.SwaggerGen; + +global using System.ComponentModel; global using System.Diagnostics.CodeAnalysis; +global using System.Globalization; +global using System.Reflection; global using System.Runtime.CompilerServices; global using System.Runtime.InteropServices; global using System.Text.Json; global using System.Text.Json.Serialization; -global using System.ComponentModel; -global using System.Globalization; -global using System.Reflection; -global using Swashbuckle.AspNetCore.SwaggerGen; \ No newline at end of file + +global using Vogen; diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenParsable.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenParsable.cs index 1ce596b5..ba0a61b9 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenParsable.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenParsable.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; +namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; public interface IVogenParsable where TVogen : IVogen diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenSpanParsable.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenSpanParsable.cs index 1d1b912d..1424efd2 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenSpanParsable.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenSpanParsable.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; +namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; public interface IVogenSpanParsable where TVogen : IVogen diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenUtf8SpanParsable.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenUtf8SpanParsable.cs index 144b0215..8e1a2b73 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenUtf8SpanParsable.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/IVogenUtf8SpanParsable.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; +namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; public interface IVogenUtf8SpanParsable where TVogen : IVogen diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/VogenSchemaFilter.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/VogenSchemaFilter.cs index 9afb8803..0bb27e11 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/VogenSchemaFilter.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/VogenSchemaFilter.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; +namespace BUTR.Site.NexusMods.Server.ValueObjects.Utils; public sealed class VogenSchemaFilter : ISchemaFilter { diff --git a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/_QueryableHelper.cs b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/_QueryableHelper.cs index 42a37e9b..1346e9b3 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/_QueryableHelper.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Utils/_QueryableHelper.cs @@ -1,4 +1,4 @@ -namespace BUTR.Site.NexusMods.Server.Utils; +namespace BUTR.Site.NexusMods.Server.Utils; public static class QueryableHelper { diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextRead.cs b/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextRead.cs index 04d7f850..c09830b3 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextRead.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextRead.cs @@ -18,7 +18,7 @@ public AppDbContextRead( IEntityConfigurationFactory entityConfigurationFactory, DbContextOptions options) : base(dataSourceProvider, entityConfigurationFactory, options) { - + } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextWrite.cs b/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextWrite.cs index 00b78d8a..d2982e07 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextWrite.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/AppDbContextWrite.cs @@ -52,7 +52,7 @@ public async ValueTask DisposeAsync() } private readonly ITenantContextAccessor _tenantContextAccessor; - + private EntityFactory? _entityFactory; private List>? _onSave; diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/BaseEntityConfiguration.cs b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/BaseEntityConfiguration.cs index 3d9c5503..837e3d61 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/BaseEntityConfiguration.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/BaseEntityConfiguration.cs @@ -5,7 +5,7 @@ namespace BUTR.Site.NexusMods.Server.Contexts.Configs; -public abstract class BaseEntityConfiguration: IEntityConfiguration where TEntity : class, IEntity +public abstract class BaseEntityConfiguration : IEntityConfiguration where TEntity : class, IEntity { public virtual void Configure(ModelBuilder builder) => ConfigureModel(builder.Entity()); protected virtual void ConfigureModel(EntityTypeBuilder builder) { } diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/IEntityConfiguration.cs b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/IEntityConfiguration.cs index 4b0aab8b..030230d9 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/Configs/IEntityConfiguration.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/Configs/IEntityConfiguration.cs @@ -1,3 +1,3 @@ -namespace BUTR.Site.NexusMods.Server.Contexts.Configs; +namespace BUTR.Site.NexusMods.Server.Contexts.Configs; public interface IEntityConfiguration; \ No newline at end of file diff --git a/src/BUTR.Site.NexusMods.Server/Contexts/NpgsqlDataSourceProvider.cs b/src/BUTR.Site.NexusMods.Server/Contexts/NpgsqlDataSourceProvider.cs index 4f0d326a..20a474bc 100644 --- a/src/BUTR.Site.NexusMods.Server/Contexts/NpgsqlDataSourceProvider.cs +++ b/src/BUTR.Site.NexusMods.Server/Contexts/NpgsqlDataSourceProvider.cs @@ -1,4 +1,4 @@ -using BUTR.Site.NexusMods.Server.Options; +using BUTR.Site.NexusMods.Server.Options; using Microsoft.Extensions.Options; @@ -12,7 +12,7 @@ public sealed class NpgsqlDataSourceProvider { private ConnectionStringsOptions _options; private JsonSerializerOptions _jsonSerializerOptions; - + private NpgsqlDataSource _main; private NpgsqlDataSource _replica; @@ -20,7 +20,7 @@ public NpgsqlDataSourceProvider(IOptionsMonitor option { _options = option.CurrentValue; _jsonSerializerOptions = jsonSerializerOptions.CurrentValue; - + option.OnChange(Listener1); jsonSerializerOptions.OnChange(Listener2); @@ -38,7 +38,7 @@ private void Rebuild() .ConfigureJsonOptions(_jsonSerializerOptions) .EnableDynamicJson() .Build(); - + _replica = new NpgsqlDataSourceBuilder(_options.Replica) .ConfigureJsonOptions(_jsonSerializerOptions) .EnableDynamicJson() diff --git a/src/BUTR.Site.NexusMods.Server/Controllers/CrashReportsAnalyzerController.cs b/src/BUTR.Site.NexusMods.Server/Controllers/CrashReportsAnalyzerController.cs index 870efefa..fd57b5f8 100644 --- a/src/BUTR.Site.NexusMods.Server/Controllers/CrashReportsAnalyzerController.cs +++ b/src/BUTR.Site.NexusMods.Server/Controllers/CrashReportsAnalyzerController.cs @@ -72,7 +72,7 @@ static bool GetTypeLoadExceptionLevel(ExceptionModel? exceptionModel, ref int le { if (ct.IsCancellationRequested) return false; - + if (exceptionModel is null) return false; diff --git a/src/BUTR.Site.NexusMods.Server/Startup.cs b/src/BUTR.Site.NexusMods.Server/Startup.cs index db848a52..b1cc3afc 100644 --- a/src/BUTR.Site.NexusMods.Server/Startup.cs +++ b/src/BUTR.Site.NexusMods.Server/Startup.cs @@ -216,7 +216,7 @@ public void ConfigureServices(IServiceCollection services) services.TryAddEnumerable(ServiceDescriptor.Scoped(typeof(IEntityConfiguration), type)); foreach (var type in types.Where(x => x.BaseType!.GetGenericTypeDefinition() == typeof(BaseEntityConfiguration<>))) services.TryAddEnumerable(ServiceDescriptor.Scoped(typeof(IEntityConfiguration), type)); - + services.AddSingleton(); services.AddDbContext(ServiceLifetime.Scoped); services.AddDbContextFactory(lifetime: ServiceLifetime.Scoped);