Skip to content

Commit

Permalink
Swicthed from From to new for Vogen instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Aragas committed May 27, 2024
1 parent a56f944 commit a7684ac
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)]
public partial struct ApplicationRole : IHasDefaultValue<TType>
{
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsApiKey : IHasDefaultValue<TType>
{
public static readonly TType None = From(string.Empty);
public static readonly TType None = new(string.Empty);

public static NexusModsApiKey DefaultValue => None;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsArticleId : IHasDefaultValue<TType>
{
public static readonly TType None = From(0);
public static readonly TType None = new(0);

public static TType DefaultValue => None;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)]
public readonly partial struct NexusModsGameDomain : IHasDefaultValue<TType>
{
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;

Expand All @@ -25,7 +25,7 @@ public static IEnumerable<TType> Values
}
}

public static bool TryParse(string urlRaw, out TType gameDomain)
public static bool TryParse(TValueType urlRaw, out TType gameDomain)
{
gameDomain = DefaultValue;

Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsModId : IHasDefaultValue<TType>
{
public static readonly TType None = From(0);
public static readonly TType None = new(0);

public static TType DefaultValue => None;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsUserEMail : IHasDefaultValue<TType>
{
public static readonly TType Empty = From(string.Empty);
public static readonly TType Empty = new(string.Empty);

public static TType DefaultValue => Empty;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsUserId : IHasDefaultValue<TType>
{
public static readonly TType None = From(0);
public static readonly TType None = new(0);

public static TType DefaultValue => None;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter)]
public readonly partial struct NexusModsUserName : IHasDefaultValue<TType>
{
public static readonly TType Empty = From(string.Empty);
public static readonly TType Empty = new(string.Empty);

public static TType DefaultValue => Empty;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace BUTR.Site.NexusMods.Server.Models;
[ValueObject<TValueType>(conversions: Conversions.EfCoreValueConverter | Conversions.SystemTextJson | Conversions.TypeConverter, deserializationStrictness: DeserializationStrictness.AllowKnownInstances)]
public readonly partial struct TenantId : IHasDefaultValue<TType>
{
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;

Expand Down

0 comments on commit a7684ac

Please sign in to comment.