Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
Updated version to 7.0.0-preview-0003
  • Loading branch information
richieedwards committed Nov 6, 2024
1 parent 6dfd9d0 commit 33fdd74
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ static IReadOnlyCollection<T> EnsureCollection<T>(List<T>? coll)
url = Navigation.GetUriWithQueryParameters(url, new Dictionary<string, object?>
{
#if NET8_0_OR_GREATER
[FiltersQueryStringParamKey] = JsonSerializer.Serialize(dicFilters, typeof(UmbrellaKeyValuePair<,>), UmbrellaKeyValuePairJsonSerializerContext.Default)
[FiltersQueryStringParamKey] = JsonSerializer.Serialize(dicFilters, UmbrellaKeyValuePairJsonSerializerContext.Default.IEnumerableUmbrellaKeyValuePairStringString)
#else
[FiltersQueryStringParamKey] = JsonSerializer.Serialize(dicFilters, _jsonSerializerOptions)
#endif
Expand Down
10 changes: 3 additions & 7 deletions Core/src/Umbrella.Utilities/Primitives/UmbrellaKeyValuePair.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System.Runtime.InteropServices;

#if NET8_0_OR_GREATER
using System.Text.Json.Serialization;
#endif

namespace Umbrella.Utilities.Primitives;

Expand All @@ -20,14 +17,13 @@ namespace Umbrella.Utilities.Primitives;
[StructLayout(LayoutKind.Auto)]
public readonly record struct UmbrellaKeyValuePair<TKey, TValue>(TKey Key, TValue Value);

#if NET8_0_OR_GREATER
/// <summary>
/// A <see cref="JsonSerializerContext" /> for use with the <see cref="UmbrellaKeyValuePair{TKey, TValue}"/> type.
/// </summary>
[JsonSourceGenerationOptions(PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase)]
[JsonSerializable(typeof(UmbrellaKeyValuePair<,>))]
[JsonSerializable(typeof(UmbrellaKeyValuePair<string, string>))]
[JsonSerializable(typeof(List<UmbrellaKeyValuePair<string, string>>))]
[JsonSerializable(typeof(IEnumerable<UmbrellaKeyValuePair<string, string>>))]
public partial class UmbrellaKeyValuePairJsonSerializerContext : JsonSerializerContext
{
}
#endif
}
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>7.0.0-preview-0002</Version>
<Version>7.0.0-preview-0003</Version>

<Nullable>enable</Nullable>
<WarningsAsErrors>nullable</WarningsAsErrors>
Expand Down

0 comments on commit 33fdd74

Please sign in to comment.