From a7684acbbb8fb51606e2808ba02f5c628d2e565f Mon Sep 17 00:00:00 2001 From: Vitalii Mikhailov Date: Mon, 27 May 2024 23:21:02 +0300 Subject: [PATCH] Swicthed from From to new for Vogen instances --- .../Models/ApplicationRole.cs | 8 ++++---- .../Models/NexusModsApiKey.cs | 2 +- .../Models/NexusModsArticleId.cs | 2 +- .../Models/NexusModsGameDomain.cs | 14 +++++++------- .../Models/NexusModsModId.cs | 2 +- .../Models/NexusModsUserEMail.cs | 2 +- .../Models/NexusModsUserId.cs | 2 +- .../Models/NexusModsUserName.cs | 2 +- .../Models/TenantId.cs | 12 ++++++------ 9 files changed, 23 insertions(+), 23 deletions(-) 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 32814566..cfb990c0 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/ApplicationRole.cs @@ -6,10 +6,10 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)] public partial struct ApplicationRole : IHasDefaultValue { - public static readonly TType Anonymous = From(ApplicationRoles.Anonymous); - 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 readonly TType Anonymous = new(ApplicationRoles.Anonymous); + public static readonly TType User = new(ApplicationRoles.User); + public static readonly TType Moderator = new(ApplicationRoles.Moderator); + public static readonly TType Administrator = new(ApplicationRoles.Administrator); public static TType DefaultValue => Anonymous; } \ No newline at end of file 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 6dd79671..935468ea 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsApiKey.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsApiKey : IHasDefaultValue { - public static readonly TType None = From(string.Empty); + public static readonly TType None = new(string.Empty); public static NexusModsApiKey DefaultValue => None; } \ No newline at end of file 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 3be3046a..ebd0d0df 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsArticleId.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsArticleId : IHasDefaultValue { - public static readonly TType None = From(0); + public static readonly TType None = new(0); public static TType DefaultValue => None; 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 44fa87aa..a24531ca 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsGameDomain.cs @@ -6,11 +6,11 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)] public readonly partial struct NexusModsGameDomain : IHasDefaultValue { - public static readonly TType None = From(string.Empty); - 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 readonly TType Valheim = From(TenantUtils.ValheimGameDomain); + public static readonly TType None = new(string.Empty); + public static readonly TType Bannerlord = new(TenantUtils.BannerlordGameDomain); + public static readonly TType Rimworld = new(TenantUtils.RimworldGameDomain); + public static readonly TType StardewValley = new(TenantUtils.StardewValleyGameDomain); + public static readonly TType Valheim = new(TenantUtils.ValheimGameDomain); public static TType DefaultValue => None; @@ -25,7 +25,7 @@ public static IEnumerable Values } } - public static bool TryParse(string urlRaw, out TType gameDomain) + public static bool TryParse(TValueType urlRaw, out TType gameDomain) { gameDomain = DefaultValue; @@ -42,7 +42,7 @@ public static bool TryParse(string urlRaw, out TType gameDomain) return true; } - public static TType FromGameDomain(string gameDomain) + public static TType FromGameDomain(TValueType gameDomain) { foreach (var nexusModsGameDomain in Values) { 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 7828a8e0..16c08a82 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsModId.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsModId : IHasDefaultValue { - public static readonly TType None = From(0); + public static readonly TType None = new(0); public static TType DefaultValue => None; 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 4018a616..a1bf6718 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserEMail.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsUserEMail : IHasDefaultValue { - public static readonly TType Empty = From(string.Empty); + public static readonly TType Empty = new(string.Empty); public static TType DefaultValue => Empty; } \ No newline at end of file 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 309416c9..7160d38b 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserId.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsUserId : IHasDefaultValue { - public static readonly TType None = From(0); + public static readonly TType None = new(0); public static TType DefaultValue => None; 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 15028f21..28323677 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/NexusModsUserName.cs @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)] public readonly partial struct NexusModsUserName : IHasDefaultValue { - public static readonly TType Empty = From(string.Empty); + public static readonly TType Empty = new(string.Empty); public static TType DefaultValue => Empty; 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 b31342ad..e9e4a757 100644 --- a/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs +++ b/src/BUTR.Site.NexusMods.Server.ValueObjects.Vogen/Models/TenantId.cs @@ -6,12 +6,12 @@ namespace BUTR.Site.NexusMods.Server.Models; [ValueObject(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)] public readonly partial struct TenantId : IHasDefaultValue { - public static readonly TType None = From(0); - 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 readonly TType Valheim = From(TenantUtils.ValheimId); - public static readonly TType Error = From(255); + public static readonly TType None = new(0); + public static readonly TType Bannerlord = new(TenantUtils.BannerlordId); + public static readonly TType Rimworld = new(TenantUtils.RimworldId); + public static readonly TType StardewValley = new(TenantUtils.StardewValleyId); + public static readonly TType Valheim = new(TenantUtils.ValheimId); + public static readonly TType Error = new(255); public static TType DefaultValue => None;