diff --git a/Datasync.Toolkit.sln b/Datasync.Toolkit.sln index 1dc0da02..f943bc3a 100644 --- a/Datasync.Toolkit.sln +++ b/Datasync.Toolkit.sln @@ -11,7 +11,6 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{D59F1489-5D74-4F52-B78B-88037EAB2838}" ProjectSection(SolutionItems) = preProject tests\Directory.Build.props = tests\Directory.Build.props - tests\EFCore.Packages.props = tests\EFCore.Packages.props EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Datasync.Server.Abstractions", "src\CommunityToolkit.Datasync.Server.Abstractions\CommunityToolkit.Datasync.Server.Abstractions.csproj", "{852F8266-603E-4FC6-A5CB-E492E747924F}" @@ -44,6 +43,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CommunityToolkit.Datasync.T EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{2D2A6EFC-015D-4258-96D4-24C78F8C59F9}" ProjectSection(SolutionItems) = preProject + Directory.Packages.props = Directory.Packages.props .github\workflows\SignedPackageFileList.txt = .github\workflows\SignedPackageFileList.txt .github\workflows\SignedTemplateFileList.txt = .github\workflows\SignedTemplateFileList.txt EndProjectSection diff --git a/Directory.Packages.props b/Directory.Packages.props index 0f2295f1..e37b40b0 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -3,34 +3,37 @@ true true - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + + + + + - - + + + diff --git a/src/CommunityToolkit.Datasync.Client/CommunityToolkit.Datasync.Client.csproj b/src/CommunityToolkit.Datasync.Client/CommunityToolkit.Datasync.Client.csproj index 9c75786f..f4831587 100644 --- a/src/CommunityToolkit.Datasync.Client/CommunityToolkit.Datasync.Client.csproj +++ b/src/CommunityToolkit.Datasync.Client/CommunityToolkit.Datasync.Client.csproj @@ -1,4 +1,4 @@ - + The client capabilities for developing applications using the Datasync Toolkit. @@ -12,7 +12,7 @@ - + diff --git a/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs b/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs index 371fdc3e..05f53379 100644 --- a/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs +++ b/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs @@ -16,7 +16,7 @@ namespace CommunityToolkit.Datasync.Client; /// public class ConcurrentObservableCollection : ObservableCollection { - private readonly SynchronizationContext context = SynchronizationContext.Current!; + private readonly SynchronizationContext? currentContext = SynchronizationContext.Current; private bool suppressNotification = false; /// @@ -151,31 +151,30 @@ public bool ReplaceIf(Func match, T replacement) /// /// The event arguments protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) - => DispatchCallback(new SynchronizationContextAdapter(this.context), RaiseCollectionChanged, e); + { + if (this.currentContext is null || SynchronizationContext.Current == this.currentContext) + { + RaiseCollectionChanged(e); + } + else + { + this.currentContext.Send(RaiseCollectionChanged, e); + } + } /// /// Event trigger to indicate that a property has changed in a thread-safe way. /// /// The event arguments protected override void OnPropertyChanged(PropertyChangedEventArgs e) - => DispatchCallback(new SynchronizationContextAdapter(this.context), RaisePropertyChanged, e); - - /// - /// Dispatches the callback to the synchronization context. If the synchronization context is - /// the current one, we can avoid a dispatch and just call the callback directly. - /// - /// The context to send the request to. - /// The callback method. - /// The parameter for the callback method. - internal static void DispatchCallback(ISynchronizationContext context, SendOrPostCallback callback, object? param) { - if (context.IsCurrentContext()) + if (this.currentContext is null || SynchronizationContext.Current == this.currentContext) { - callback(param); + RaisePropertyChanged(e); } else { - context.Send(callback, param); + this.currentContext.Send(RaisePropertyChanged, e); } } diff --git a/src/CommunityToolkit.Datasync.Client/Paging/SynchronizationContextAdapter.cs b/src/CommunityToolkit.Datasync.Client/Paging/SynchronizationContextAdapter.cs deleted file mode 100644 index 7e855179..00000000 --- a/src/CommunityToolkit.Datasync.Client/Paging/SynchronizationContextAdapter.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Diagnostics.CodeAnalysis; - -namespace CommunityToolkit.Datasync.Client.Paging; - -/// -/// An abstraction layer for the that we use -/// for mocking out context calls. -/// -internal interface ISynchronizationContext -{ - bool IsCurrentContext(); - void Send(SendOrPostCallback callback, object? state); -} - -/// -/// A concrete implementation of the that handles -/// a real synchronization context. -/// -[ExcludeFromCodeCoverage] -internal class SynchronizationContextAdapter(SynchronizationContext context) : ISynchronizationContext -{ - public bool IsCurrentContext() - => SynchronizationContext.Current == context; - - public void Send(SendOrPostCallback callback, object? state) - => context.Send(callback, state); -} diff --git a/src/CommunityToolkit.Datasync.Client/Serialization/DatasyncSerializer.cs b/src/CommunityToolkit.Datasync.Client/Serialization/DatasyncSerializer.cs index a50a206e..a2622238 100644 --- a/src/CommunityToolkit.Datasync.Client/Serialization/DatasyncSerializer.cs +++ b/src/CommunityToolkit.Datasync.Client/Serialization/DatasyncSerializer.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Azure.Core.Serialization; using System.Text.Json; using System.Text.Json.Serialization; @@ -58,7 +57,7 @@ public static string Serialize(object obj, Type objType) new DateTimeOffsetConverter(), new DateTimeConverter(), new TimeOnlyConverter(), - new MicrosoftSpatialGeoJsonConverter() + new SpatialGeoJsonConverter() }, DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingDefault, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, diff --git a/src/CommunityToolkit.Datasync.Client/Serialization/JsonExtensions.cs b/src/CommunityToolkit.Datasync.Client/Serialization/JsonExtensions.cs new file mode 100644 index 00000000..fab10d3c --- /dev/null +++ b/src/CommunityToolkit.Datasync.Client/Serialization/JsonExtensions.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text.Json; + +namespace CommunityToolkit.Datasync.Client.Serialization; + +/// +/// Extension methods for System.Text.Json. +/// +internal static class JsonExtensions +{ + /// + /// Asserts that the current token of the matches the . + /// + /// The to assert. + /// The expected of the current token. + /// The current token did not match the . + public static void Expect(in this Utf8JsonReader reader, JsonTokenType expectedTokenType) + { + if (reader.TokenType != expectedTokenType) + { + throw new JsonException($"Deserialization failed. Expected token: '{expectedTokenType}'."); + } + } +} diff --git a/src/CommunityToolkit.Datasync.Client/Serialization/SpatialGeoJsonConverter.cs b/src/CommunityToolkit.Datasync.Client/Serialization/SpatialGeoJsonConverter.cs new file mode 100644 index 00000000..33e62fea --- /dev/null +++ b/src/CommunityToolkit.Datasync.Client/Serialization/SpatialGeoJsonConverter.cs @@ -0,0 +1,108 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Spatial; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace CommunityToolkit.Datasync.Client.Serialization; + +/// +/// Converters between Microsoft.Spatial types and GeoJSON +/// +/// +/// Only handles GeographyPoint at this time. +/// +/// +public class SpatialGeoJsonConverter : JsonConverter +{ + private const string CoordinatesPropertyName = "coordinates"; + private const string PointTypeName = "Point"; + private const string TypePropertyName = "type"; + + private static readonly JsonEncodedText s_CoordinatesPropertyNameBytes = JsonEncodedText.Encode(CoordinatesPropertyName); + private static readonly JsonEncodedText s_TypePropertyNameBytes = JsonEncodedText.Encode(TypePropertyName); + + /// + public override bool CanConvert(Type typeToConvert) => + typeof(GeographyPoint).IsAssignableFrom(typeToConvert); + + /// + public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + { + return null; + } + + string? type = default; + double? longitude = default; + double? latitude = default; + + reader.Expect(JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + reader.Expect(JsonTokenType.PropertyName); + string? propertyName = reader.GetString(); + + _ = reader.Read(); + if (string.Equals(TypePropertyName, propertyName, StringComparison.Ordinal)) + { + reader.Expect(JsonTokenType.String); + type = reader.GetString(); + } + else if (string.Equals(CoordinatesPropertyName, propertyName, StringComparison.Ordinal)) + { + reader.Expect(JsonTokenType.StartArray); + + // Longitude + _ = reader.Read(); + reader.Expect(JsonTokenType.Number); + longitude = reader.GetDouble(); + + // Latitude + _ = reader.Read(); + reader.Expect(JsonTokenType.Number); + latitude = reader.GetDouble(); + + // Skip the rest. + do + { + _ = reader.Read(); + } while (reader.TokenType != JsonTokenType.EndArray); + } + else + { + reader.Skip(); + } + } + + if (!string.Equals(PointTypeName, type, StringComparison.Ordinal)) + { + throw new JsonException($"Deserialization of {nameof(GeographyPoint)} failed. Expected geographic type: '{PointTypeName}'."); + } + + if (!longitude.HasValue || !latitude.HasValue) + { + throw new JsonException($"Deserialization of {nameof(GeographyPoint)} failed. Expected both longitude and latitude."); + } + + return GeographyPoint.Create(latitude.Value, longitude.Value); + } + + /// + public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options) + { + if (value is GeographyPoint point) + { + writer.WriteStartObject(); + writer.WriteString(s_TypePropertyNameBytes, PointTypeName); + writer.WriteStartArray(s_CoordinatesPropertyNameBytes); + writer.WriteNumberValue(point.Longitude); + writer.WriteNumberValue(point.Latitude); + writer.WriteEndArray(); + writer.WriteEndObject(); + } + } +} diff --git a/src/CommunityToolkit.Datasync.Server.Abstractions/CommunityToolkit.Datasync.Server.Abstractions.csproj b/src/CommunityToolkit.Datasync.Server.Abstractions/CommunityToolkit.Datasync.Server.Abstractions.csproj index e2ed021a..db2d1908 100644 --- a/src/CommunityToolkit.Datasync.Server.Abstractions/CommunityToolkit.Datasync.Server.Abstractions.csproj +++ b/src/CommunityToolkit.Datasync.Server.Abstractions/CommunityToolkit.Datasync.Server.Abstractions.csproj @@ -2,8 +2,7 @@ Abstractions for developing server-side applications using the Datasync Toolkit. - - + diff --git a/src/CommunityToolkit.Datasync.Server.Abstractions/Json/JsonExtensions.cs b/src/CommunityToolkit.Datasync.Server.Abstractions/Json/JsonExtensions.cs new file mode 100644 index 00000000..abc33dd8 --- /dev/null +++ b/src/CommunityToolkit.Datasync.Server.Abstractions/Json/JsonExtensions.cs @@ -0,0 +1,27 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Text.Json; + +namespace CommunityToolkit.Datasync.Server.Abstractions.Json; + +/// +/// Extension methods for System.Text.Json. +/// +internal static class JsonExtensions +{ + /// + /// Asserts that the current token of the matches the . + /// + /// The to assert. + /// The expected of the current token. + /// The current token did not match the . + public static void Expect(in this Utf8JsonReader reader, JsonTokenType expectedTokenType) + { + if (reader.TokenType != expectedTokenType) + { + throw new JsonException($"Deserialization failed. Expected token: '{expectedTokenType}'."); + } + } +} diff --git a/src/CommunityToolkit.Datasync.Server.Abstractions/Json/SpatialGeoJsonConverter.cs b/src/CommunityToolkit.Datasync.Server.Abstractions/Json/SpatialGeoJsonConverter.cs new file mode 100644 index 00000000..9e1bf460 --- /dev/null +++ b/src/CommunityToolkit.Datasync.Server.Abstractions/Json/SpatialGeoJsonConverter.cs @@ -0,0 +1,108 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.Spatial; +using System.Text.Json; +using System.Text.Json.Serialization; + +namespace CommunityToolkit.Datasync.Server.Abstractions.Json; + +/// +/// Converters between Microsoft.Spatial types and GeoJSON +/// +/// +/// Only handles GeographyPoint at this time. +/// +/// +public class SpatialGeoJsonConverter : JsonConverter +{ + private const string CoordinatesPropertyName = "coordinates"; + private const string PointTypeName = "Point"; + private const string TypePropertyName = "type"; + + private static readonly JsonEncodedText s_CoordinatesPropertyNameBytes = JsonEncodedText.Encode(CoordinatesPropertyName); + private static readonly JsonEncodedText s_TypePropertyNameBytes = JsonEncodedText.Encode(TypePropertyName); + + /// + public override bool CanConvert(Type typeToConvert) => + typeof(GeographyPoint).IsAssignableFrom(typeToConvert); + + /// + public override object? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) + { + if (reader.TokenType == JsonTokenType.Null) + { + return null; + } + + string? type = default; + double? longitude = default; + double? latitude = default; + + reader.Expect(JsonTokenType.StartObject); + while (reader.Read() && reader.TokenType != JsonTokenType.EndObject) + { + reader.Expect(JsonTokenType.PropertyName); + string? propertyName = reader.GetString(); + + _ = reader.Read(); + if (string.Equals(TypePropertyName, propertyName, StringComparison.Ordinal)) + { + reader.Expect(JsonTokenType.String); + type = reader.GetString(); + } + else if (string.Equals(CoordinatesPropertyName, propertyName, StringComparison.Ordinal)) + { + reader.Expect(JsonTokenType.StartArray); + + // Longitude + _ = reader.Read(); + reader.Expect(JsonTokenType.Number); + longitude = reader.GetDouble(); + + // Latitude + _ = reader.Read(); + reader.Expect(JsonTokenType.Number); + latitude = reader.GetDouble(); + + // Skip the rest. + do + { + _ = reader.Read(); + } while (reader.TokenType != JsonTokenType.EndArray); + } + else + { + reader.Skip(); + } + } + + if (!string.Equals(PointTypeName, type, StringComparison.Ordinal)) + { + throw new JsonException($"Deserialization of {nameof(GeographyPoint)} failed. Expected geographic type: '{PointTypeName}'."); + } + + if (!longitude.HasValue || !latitude.HasValue) + { + throw new JsonException($"Deserialization of {nameof(GeographyPoint)} failed. Expected both longitude and latitude."); + } + + return GeographyPoint.Create(latitude.Value, longitude.Value); + } + + /// + public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOptions options) + { + if (value is GeographyPoint point) + { + writer.WriteStartObject(); + writer.WriteString(s_TypePropertyNameBytes, PointTypeName); + writer.WriteStartArray(s_CoordinatesPropertyNameBytes); + writer.WriteNumberValue(point.Longitude); + writer.WriteNumberValue(point.Latitude); + writer.WriteEndArray(); + writer.WriteEndObject(); + } + } +} diff --git a/src/CommunityToolkit.Datasync.Server.InMemory/DatasyncExtensions.cs b/src/CommunityToolkit.Datasync.Server.InMemory/DatasyncExtensions.cs index 2ca0b427..f558ab1c 100644 --- a/src/CommunityToolkit.Datasync.Server.InMemory/DatasyncExtensions.cs +++ b/src/CommunityToolkit.Datasync.Server.InMemory/DatasyncExtensions.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Azure.Core.Serialization; using CommunityToolkit.Datasync.Server.Abstractions.Json; using System.Text.Json; using System.Text.Json.Serialization; @@ -32,7 +31,7 @@ public static TEntity Clone(this TEntity entity) new DateTimeOffsetConverter(), new DateTimeConverter(), new TimeOnlyConverter(), - new MicrosoftSpatialGeoJsonConverter() + new SpatialGeoJsonConverter() }, DefaultIgnoreCondition = JsonIgnoreCondition.Never, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, diff --git a/src/CommunityToolkit.Datasync.Server/CommunityToolkit.Datasync.Server.csproj b/src/CommunityToolkit.Datasync.Server/CommunityToolkit.Datasync.Server.csproj index 8740946c..5e13ef1d 100644 --- a/src/CommunityToolkit.Datasync.Server/CommunityToolkit.Datasync.Server.csproj +++ b/src/CommunityToolkit.Datasync.Server/CommunityToolkit.Datasync.Server.csproj @@ -13,7 +13,6 @@ - diff --git a/src/CommunityToolkit.Datasync.Server/Controllers/TableController.Query.cs b/src/CommunityToolkit.Datasync.Server/Controllers/TableController.Query.cs index f719dcb2..af65def2 100644 --- a/src/CommunityToolkit.Datasync.Server/Controllers/TableController.Query.cs +++ b/src/CommunityToolkit.Datasync.Server/Controllers/TableController.Query.cs @@ -105,9 +105,8 @@ protected static IServiceProvider BuildServiceProvider(HttpRequest request) services .AddScoped() - .AddScoped() + .AddScoped(_ => new ODataQuerySettings { EnsureStableOrdering = true }) .AddSingleton(_ => new UnqualifiedODataUriResolver { EnableCaseInsensitive = true }) - .AddScoped() .AddScoped(); IServiceProvider provider = services.BuildServiceProvider(); diff --git a/src/CommunityToolkit.Datasync.Server/Extensions/InternalExtensions.cs b/src/CommunityToolkit.Datasync.Server/Extensions/InternalExtensions.cs index 54152110..0a435753 100644 --- a/src/CommunityToolkit.Datasync.Server/Extensions/InternalExtensions.cs +++ b/src/CommunityToolkit.Datasync.Server/Extensions/InternalExtensions.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Azure.Core.Serialization; using CommunityToolkit.Datasync.Server.Abstractions.Json; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; @@ -66,7 +65,7 @@ internal static bool EntityIsInView(this IAccessControlProvider + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Client.Test/Offline/OfflineDbContext_Tests.cs b/tests/CommunityToolkit.Datasync.Client.Test/Offline/OfflineDbContext_Tests.cs index 16e16ada..7e85ad6f 100644 --- a/tests/CommunityToolkit.Datasync.Client.Test/Offline/OfflineDbContext_Tests.cs +++ b/tests/CommunityToolkit.Datasync.Client.Test/Offline/OfflineDbContext_Tests.cs @@ -521,7 +521,7 @@ public async Task DbSet_PushAsync_NoOperations() } [Fact] - public async void PushAsync_Addition_Works() + public async Task PushAsync_Addition_Works() { ClientMovie clientMovie = new(TestData.Movies.BlackPanther) { Id = Guid.NewGuid().ToString("N") }; string clientMovieJson = DatasyncSerializer.Serialize(clientMovie); @@ -545,7 +545,7 @@ public async void PushAsync_Addition_Works() } [Fact] - public async void DbSet_PushAsync_Addition_Works() + public async Task DbSet_PushAsync_Addition_Works() { ClientMovie clientMovie = new(TestData.Movies.BlackPanther) { Id = Guid.NewGuid().ToString("N") }; string clientMovieJson = DatasyncSerializer.Serialize(clientMovie); diff --git a/tests/CommunityToolkit.Datasync.Client.Test/Offline/OperationsQueueManager_Tests.cs b/tests/CommunityToolkit.Datasync.Client.Test/Offline/OperationsQueueManager_Tests.cs index 095f1424..3fc9d580 100644 --- a/tests/CommunityToolkit.Datasync.Client.Test/Offline/OperationsQueueManager_Tests.cs +++ b/tests/CommunityToolkit.Datasync.Client.Test/Offline/OperationsQueueManager_Tests.cs @@ -123,7 +123,7 @@ public async Task PushAsync_NoOperations() } [Fact] - public async void PushAsync_Addition_Works() + public async Task PushAsync_Addition_Works() { ClientMovie clientMovie = new(TestData.Movies.BlackPanther) { Id = Guid.NewGuid().ToString("N") }; string clientMovieJson = DatasyncSerializer.Serialize(clientMovie); diff --git a/tests/CommunityToolkit.Datasync.Client.Test/Paging/ConcurrentObservableCollection_Tests.cs b/tests/CommunityToolkit.Datasync.Client.Test/Paging/ConcurrentObservableCollection_Tests.cs index d074bb20..4f71bd6f 100644 --- a/tests/CommunityToolkit.Datasync.Client.Test/Paging/ConcurrentObservableCollection_Tests.cs +++ b/tests/CommunityToolkit.Datasync.Client.Test/Paging/ConcurrentObservableCollection_Tests.cs @@ -180,40 +180,4 @@ public void ReplaceIf_False_IfNoMatch() actual.Should().BeFalse(); this.movies.Should().HaveCount(count).And.NotContain(item); } - - [Fact] - public void DispatchCallback_DispatchesToSynchronizationContext() - { - int contextCaller = 0; - int functionCaller = 0; - - void dispatcher(object p) { functionCaller++; } - - ISynchronizationContext context = Substitute.For(); - context.IsCurrentContext().Returns(false); - context.When(x => x.Send(Arg.Any(), Arg.Any())).Do(x => contextCaller++); - - ConcurrentObservableCollection.DispatchCallback(context, dispatcher, new object()); - - contextCaller.Should().Be(1); - functionCaller.Should().Be(0); - } - - [Fact] - public void DispatchCallback_DispatchesLocally() - { - int contextCaller = 0; - int functionCaller = 0; - - void dispatcher(object p) { functionCaller++; } - - ISynchronizationContext context = Substitute.For(); - context.IsCurrentContext().Returns(true); - context.When(x => x.Send(Arg.Any(), Arg.Any())).Do(x => contextCaller++); - - ConcurrentObservableCollection.DispatchCallback(context, dispatcher, new object()); - - contextCaller.Should().Be(0); - functionCaller.Should().Be(1); - } } \ No newline at end of file diff --git a/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/CommunityToolkit.Datasync.Server.Abstractions.Test.csproj b/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/CommunityToolkit.Datasync.Server.Abstractions.Test.csproj index 3f75ef06..97980f0f 100644 --- a/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/CommunityToolkit.Datasync.Server.Abstractions.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/CommunityToolkit.Datasync.Server.Abstractions.Test.csproj @@ -2,4 +2,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/Json/SerializerTests.cs b/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/Json/SerializerTests.cs index a6716a63..0a74f6f8 100644 --- a/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/Json/SerializerTests.cs +++ b/tests/CommunityToolkit.Datasync.Server.Abstractions.Test/Json/SerializerTests.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. -using Azure.Core.Serialization; using CommunityToolkit.Datasync.Server.Abstractions.Json; using System.Globalization; using System.Text.Json; @@ -28,7 +27,7 @@ public abstract class SerializerTests new DateTimeOffsetConverter(), new DateTimeConverter(), new TimeOnlyConverter(), - new MicrosoftSpatialGeoJsonConverter() + new SpatialGeoJsonConverter() }, DefaultIgnoreCondition = JsonIgnoreCondition.Never, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, diff --git a/tests/CommunityToolkit.Datasync.Server.Automapper.Test/CommunityToolkit.Datasync.Server.Automapper.Test.csproj b/tests/CommunityToolkit.Datasync.Server.Automapper.Test/CommunityToolkit.Datasync.Server.Automapper.Test.csproj index 23ad8252..f9d81cd2 100644 --- a/tests/CommunityToolkit.Datasync.Server.Automapper.Test/CommunityToolkit.Datasync.Server.Automapper.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.Automapper.Test/CommunityToolkit.Datasync.Server.Automapper.Test.csproj @@ -4,4 +4,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test.csproj b/tests/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test.csproj index a965d498..965b7729 100644 --- a/tests/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test/CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test.csproj @@ -6,4 +6,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.InMemory.Test/CommunityToolkit.Datasync.Server.InMemory.Test.csproj b/tests/CommunityToolkit.Datasync.Server.InMemory.Test/CommunityToolkit.Datasync.Server.InMemory.Test.csproj index 565dff36..8a370645 100644 --- a/tests/CommunityToolkit.Datasync.Server.InMemory.Test/CommunityToolkit.Datasync.Server.InMemory.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.InMemory.Test/CommunityToolkit.Datasync.Server.InMemory.Test.csproj @@ -6,4 +6,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.LiteDb.Test/CommunityToolkit.Datasync.Server.LiteDb.Test.csproj b/tests/CommunityToolkit.Datasync.Server.LiteDb.Test/CommunityToolkit.Datasync.Server.LiteDb.Test.csproj index 1744fd72..39561d45 100644 --- a/tests/CommunityToolkit.Datasync.Server.LiteDb.Test/CommunityToolkit.Datasync.Server.LiteDb.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.LiteDb.Test/CommunityToolkit.Datasync.Server.LiteDb.Test.csproj @@ -6,4 +6,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.NSwag.Test/CommunityToolkit.Datasync.Server.NSwag.Test.csproj b/tests/CommunityToolkit.Datasync.Server.NSwag.Test/CommunityToolkit.Datasync.Server.NSwag.Test.csproj index 5b6fcbe9..16246a53 100644 --- a/tests/CommunityToolkit.Datasync.Server.NSwag.Test/CommunityToolkit.Datasync.Server.NSwag.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.NSwag.Test/CommunityToolkit.Datasync.Server.NSwag.Test.csproj @@ -13,4 +13,19 @@ + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.Swashbuckle.Test/CommunityToolkit.Datasync.Server.Swashbuckle.Test.csproj b/tests/CommunityToolkit.Datasync.Server.Swashbuckle.Test/CommunityToolkit.Datasync.Server.Swashbuckle.Test.csproj index c0a472bd..1831fb3c 100644 --- a/tests/CommunityToolkit.Datasync.Server.Swashbuckle.Test/CommunityToolkit.Datasync.Server.Swashbuckle.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.Swashbuckle.Test/CommunityToolkit.Datasync.Server.Swashbuckle.Test.csproj @@ -14,4 +14,23 @@ + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.Server.Test/CommunityToolkit.Datasync.Server.Test.csproj b/tests/CommunityToolkit.Datasync.Server.Test/CommunityToolkit.Datasync.Server.Test.csproj index 3d74d7ad..192b804c 100644 --- a/tests/CommunityToolkit.Datasync.Server.Test/CommunityToolkit.Datasync.Server.Test.csproj +++ b/tests/CommunityToolkit.Datasync.Server.Test/CommunityToolkit.Datasync.Server.Test.csproj @@ -4,4 +4,18 @@ + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + diff --git a/tests/CommunityToolkit.Datasync.TestCommon/LibraryExtensions.cs b/tests/CommunityToolkit.Datasync.TestCommon/LibraryExtensions.cs index 569075a2..f6d848bf 100644 --- a/tests/CommunityToolkit.Datasync.TestCommon/LibraryExtensions.cs +++ b/tests/CommunityToolkit.Datasync.TestCommon/LibraryExtensions.cs @@ -68,7 +68,7 @@ public static TEntity Clone(this TEntity entity) new DateTimeOffsetConverter(), new DateTimeConverter(), new TimeOnlyConverter(), - new MicrosoftSpatialGeoJsonConverter() + new SpatialGeoJsonConverter() }, DefaultIgnoreCondition = JsonIgnoreCondition.Never, DictionaryKeyPolicy = JsonNamingPolicy.CamelCase, diff --git a/tests/Directory.Build.props b/tests/Directory.Build.props index 00f7aad5..06698079 100644 --- a/tests/Directory.Build.props +++ b/tests/Directory.Build.props @@ -40,18 +40,6 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - runtime; build; native; contentfiles; analyzers; buildtransitive - all -