diff --git a/src/Extensions/DesignTimeDbContextFactory.cs b/src/Extensions/DesignTimeDbContextFactory.cs index fc54452..717a99c 100644 --- a/src/Extensions/DesignTimeDbContextFactory.cs +++ b/src/Extensions/DesignTimeDbContextFactory.cs @@ -24,10 +24,10 @@ public virtual IConfigurationBuilder Configure(IConfigurationBuilder configBuild public virtual SqlServerDbContextOptionsBuilder Configure( SqlServerDbContextOptionsBuilder optionsBuilder ) - { - #if NET8_0_OR_GREATER + { +#if NET8_0_OR_GREATER return optionsBuilder = optionsBuilder.UseAzureSqlDefaults(); - #endif +#endif return optionsBuilder; } diff --git a/src/Models/Slug.cs b/src/Models/Slug.cs index 91b7e14..85f15c7 100644 --- a/src/Models/Slug.cs +++ b/src/Models/Slug.cs @@ -6,33 +6,33 @@ namespace Dgmjr.EntityFrameworkCore; public readonly partial struct Slug(string Value) : IComparable, IEquatable, IComparable { public Slug() - : this(NewSlug()) { } - - public string Value { get; init; } = Value; - - public int CompareTo(Slug other) - => Compare(Value, other.Value, OrdinalIgnoreCase); - - public int CompareTo(object obj) - => obj is Slug other ? CompareTo(other) : 1; - - public static string NewSlug() - => guid.NewGuid().ToString("N").Substring(0, 6).ToLowerInvariant(); - - public override string ToString() - => Value; - - public bool Equals(Slug other) - => CompareTo(other) == 0; - - public override bool Equals(object? obj) - => obj is Slug other && Equals(other); - - public static bool operator==(Slug left, Slug right) - => left.Equals(right); - - public static bool operator!=(Slug left, Slug right) - => !left.Equals(right); + : this(NewSlug()) { } + +public string Value { get; init; } = Value; + +public int CompareTo(Slug other) + => Compare(Value, other.Value, OrdinalIgnoreCase); + +public int CompareTo(object obj) + => obj is Slug other ? CompareTo(other) : 1; + +public static string NewSlug() + => guid.NewGuid().ToString("N").Substring(0, 6).ToLowerInvariant(); + +public override string ToString() + => Value; + +public bool Equals(Slug other) + => CompareTo(other) == 0; + +public override bool Equals(object? obj) + => obj is Slug other && Equals(other); + +public static bool operator ==(Slug left, Slug right) + => left.Equals(right); + +public static bool operator !=(Slug left, Slug right) + => !left.Equals(right); } public class SlugEfCoreConverter : ValueConverter