diff --git a/src/CommunityToolkit.Datasync.Client/Exceptions/EntityDoesNotExistException.cs b/src/CommunityToolkit.Datasync.Client/Exceptions/EntityDoesNotExistException.cs index c8fb0c0..8c7e910 100644 --- a/src/CommunityToolkit.Datasync.Client/Exceptions/EntityDoesNotExistException.cs +++ b/src/CommunityToolkit.Datasync.Client/Exceptions/EntityDoesNotExistException.cs @@ -2,8 +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 CommunityToolkit.Datasync.Client.Service; - namespace CommunityToolkit.Datasync.Client; /// diff --git a/src/CommunityToolkit.Datasync.Client/Offline/DatasyncOfflineOptionsBuilder.cs b/src/CommunityToolkit.Datasync.Client/Offline/DatasyncOfflineOptionsBuilder.cs index 9dc17fd..dd3b859 100644 --- a/src/CommunityToolkit.Datasync.Client/Offline/DatasyncOfflineOptionsBuilder.cs +++ b/src/CommunityToolkit.Datasync.Client/Offline/DatasyncOfflineOptionsBuilder.cs @@ -33,7 +33,7 @@ internal DatasyncOfflineOptionsBuilder(IEnumerable entityTypes) /// The current builder for chaining. public DatasyncOfflineOptionsBuilder UseHttpClientFactory(IHttpClientFactory httpClientFactory) { - ArgumentNullException.ThrowIfNull(httpClientFactory, nameof(httpClientFactory)); + ArgumentNullException.ThrowIfNull(httpClientFactory); this._httpClientFactory = httpClientFactory; return this; } @@ -46,7 +46,7 @@ public DatasyncOfflineOptionsBuilder UseHttpClientFactory(IHttpClientFactory htt /// The current builder for chaining. public DatasyncOfflineOptionsBuilder UseHttpClient(HttpClient httpClient) { - ArgumentNullException.ThrowIfNull(httpClient, nameof(httpClient)); + ArgumentNullException.ThrowIfNull(httpClient); this._httpClientFactory = new BasicHttpClientFactory(httpClient); return this; } @@ -59,7 +59,7 @@ public DatasyncOfflineOptionsBuilder UseHttpClient(HttpClient httpClient) /// The current builder for chaining. public DatasyncOfflineOptionsBuilder UseEndpoint(Uri endpoint) { - ArgumentNullException.ThrowIfNull(endpoint, nameof(endpoint)); + ArgumentNullException.ThrowIfNull(endpoint); ThrowIf.IsNotValidEndpoint(endpoint, nameof(endpoint)); this._httpClientFactory = new HttpClientFactory(new HttpClientOptions { Endpoint = endpoint }); return this; @@ -73,7 +73,7 @@ public DatasyncOfflineOptionsBuilder UseEndpoint(Uri endpoint) /// The current builder for chaining. public DatasyncOfflineOptionsBuilder UseHttpClientOptions(HttpClientOptions clientOptions) { - ArgumentNullException.ThrowIfNull(clientOptions, nameof(clientOptions)); + ArgumentNullException.ThrowIfNull(clientOptions); this._httpClientFactory = new HttpClientFactory(clientOptions); return this; } @@ -86,7 +86,7 @@ public DatasyncOfflineOptionsBuilder UseHttpClientOptions(HttpClientOptions clie /// The current builder for chaining. public DatasyncOfflineOptionsBuilder Entity(Action> configure) where TEntity : class { - ArgumentNullException.ThrowIfNull(configure, nameof(configure)); + ArgumentNullException.ThrowIfNull(configure); if (!this._entities.TryGetValue(typeof(TEntity).FullName!, out EntityOfflineOptions? options)) { throw new DatasyncException($"Entity is not synchronizable."); @@ -108,8 +108,8 @@ public DatasyncOfflineOptionsBuilder Entity(ActionThe current builder for chaining. public DatasyncOfflineOptionsBuilder Entity(Type entityType, Action configure) { - ArgumentNullException.ThrowIfNull(entityType, nameof(entityType)); - ArgumentNullException.ThrowIfNull(configure, nameof(configure)); + ArgumentNullException.ThrowIfNull(entityType); + ArgumentNullException.ThrowIfNull(configure); if (!this._entities.TryGetValue(entityType.FullName!, out EntityOfflineOptions? options)) { throw new DatasyncException($"Entity is not synchronizable."); diff --git a/src/CommunityToolkit.Datasync.Client/Offline/OfflineDbContext.cs b/src/CommunityToolkit.Datasync.Client/Offline/OfflineDbContext.cs index 4a87242..6e9b7cc 100644 --- a/src/CommunityToolkit.Datasync.Client/Offline/OfflineDbContext.cs +++ b/src/CommunityToolkit.Datasync.Client/Offline/OfflineDbContext.cs @@ -240,7 +240,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder) /// The results of the pull operation. public Task PullAsync(IEnumerable entityTypes, PullOptions pullOptions, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(entityTypes, nameof(entityTypes)); + ArgumentNullException.ThrowIfNull(entityTypes); ArgumentValidationException.ThrowIfNotValid(pullOptions, nameof(pullOptions)); OfflineOptions offlineOptions = BuildDatasyncOfflineOptions(); @@ -281,7 +281,7 @@ public Task PullAsync(Action configureAction, Ca /// The results of the pull operation. internal async Task PullAsync(IEnumerable pullRequests, PullOptions pullOptions, CancellationToken cancellationToken) { - ArgumentNullException.ThrowIfNull(pullRequests, nameof(pullRequests)); + ArgumentNullException.ThrowIfNull(pullRequests); ArgumentValidationException.ThrowIfNotValid(pullOptions, nameof(pullOptions)); if (!pullRequests.Any()) diff --git a/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs b/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs index d9bb66f..1ffc3e6 100644 --- a/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs +++ b/src/CommunityToolkit.Datasync.Client/Offline/OperationsQueue/OperationsQueueManager.cs @@ -81,7 +81,7 @@ internal List GetChangedEntitiesInScope() /// internal Dictionary GetEntityMap(OfflineDbContext context) { - ArgumentNullException.ThrowIfNull(context, nameof(context)); + ArgumentNullException.ThrowIfNull(context); Type[] modelEntities = context.Model.GetEntityTypes().Select(m => m.ClrType).ToArray(); Type[] synchronizableEntities = context.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance) @@ -239,7 +239,7 @@ internal bool IsSynchronizationEntity(PropertyInfo property) /// The results of the push operation (asynchronously) internal async Task PushAsync(IEnumerable entityTypes, PushOptions pushOptions, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(entityTypes, nameof(entityTypes)); + ArgumentNullException.ThrowIfNull(entityTypes); ArgumentValidationException.ThrowIfNotValid(pushOptions, nameof(pushOptions)); PushResult pushResult = new(); diff --git a/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs b/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs index 52cb81f..371fdc3 100644 --- a/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs +++ b/src/CommunityToolkit.Datasync.Client/Paging/ConcurrentObservableCollection.cs @@ -40,7 +40,7 @@ public ConcurrentObservableCollection(IEnumerable list) : base(list) /// The new collection. public void ReplaceAll(IEnumerable collection) { - ArgumentNullException.ThrowIfNull(collection, nameof(collection)); + ArgumentNullException.ThrowIfNull(collection); try { this.suppressNotification = true; @@ -65,7 +65,7 @@ public void ReplaceAll(IEnumerable collection) /// true if any records were added; false otherwise. public bool AddRange(IEnumerable collection) { - ArgumentNullException.ThrowIfNull(collection, nameof(collection)); + ArgumentNullException.ThrowIfNull(collection); bool changed = false; try { @@ -97,8 +97,8 @@ public bool AddRange(IEnumerable collection) /// true if the item was added, false otherwise. public bool AddIfMissing(Func match, T item) { - ArgumentNullException.ThrowIfNull(match, nameof(match)); - ArgumentNullException.ThrowIfNull(item, nameof(item)); + ArgumentNullException.ThrowIfNull(match); + ArgumentNullException.ThrowIfNull(item); if (!this.Any(match)) { Add(item); @@ -115,7 +115,7 @@ public bool AddIfMissing(Func match, T item) /// true if an item was removed, false otherwise. public bool RemoveIf(Func match) { - ArgumentNullException.ThrowIfNull(match, nameof(match)); + ArgumentNullException.ThrowIfNull(match); T[] itemsToRemove = this.Where(match).ToArray(); foreach (T? item in itemsToRemove) { @@ -134,8 +134,8 @@ public bool RemoveIf(Func match) /// true if an item was replaced, false otherwise. public bool ReplaceIf(Func match, T replacement) { - ArgumentNullException.ThrowIfNull(match, nameof(match)); - ArgumentNullException.ThrowIfNull(replacement, nameof(replacement)); + ArgumentNullException.ThrowIfNull(match); + ArgumentNullException.ThrowIfNull(replacement); T[] itemsToReplace = this.Where(match).ToArray(); foreach (T? item in itemsToReplace) { diff --git a/src/CommunityToolkit.Datasync.Client/Query/IAsyncEnumerableExtensions.cs b/src/CommunityToolkit.Datasync.Client/Query/IAsyncEnumerableExtensions.cs index 801213c..562c3af 100644 --- a/src/CommunityToolkit.Datasync.Client/Query/IAsyncEnumerableExtensions.cs +++ b/src/CommunityToolkit.Datasync.Client/Query/IAsyncEnumerableExtensions.cs @@ -25,7 +25,7 @@ internal static class IAsyncEnumerableExtensions /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. internal static async ValueTask ToDatasyncArrayAsync(this IAsyncEnumerable source, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(source, nameof(source)); + ArgumentNullException.ThrowIfNull(source); List list = await source.ToDatasyncListAsync(cancellationToken).ConfigureAwait(false); return [.. list]; } @@ -58,8 +58,8 @@ internal static ValueTask> ToDatasyncDictionaryAsyncThe return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. internal static async ValueTask> ToDatasyncDictionaryAsync(this IAsyncEnumerable source, Func keySelector, IEqualityComparer? comparer, CancellationToken cancellationToken = default) where TKey : notnull { - ArgumentNullException.ThrowIfNull(source, nameof(source)); - ArgumentNullException.ThrowIfNull(keySelector, nameof(keySelector)); + ArgumentNullException.ThrowIfNull(source); + ArgumentNullException.ThrowIfNull(keySelector); Dictionary d = new(comparer); await foreach (TSource? item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) { @@ -94,7 +94,7 @@ internal static ValueTask> ToDatasyncHashSetAsync(this /// The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior. internal static async ValueTask> ToDatasyncHashSetAsync(this IAsyncEnumerable source, IEqualityComparer? comparer, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(source, nameof(source)); + ArgumentNullException.ThrowIfNull(source); HashSet set = new(comparer); await foreach (TSource? item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) { @@ -114,7 +114,7 @@ internal static async ValueTask> ToDatasyncHashSetAsync is null. internal static async ValueTask> ToDatasyncListAsync(this IAsyncEnumerable source, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(source, nameof(source)); + ArgumentNullException.ThrowIfNull(source); List list = []; await foreach (TSource? item in source.WithCancellation(cancellationToken).ConfigureAwait(false)) { @@ -146,7 +146,7 @@ internal static ValueTask> ToDatasyncObs /// is null. internal static async ValueTask> ToDatasyncObservableCollectionAsync(this IAsyncEnumerable source, ConcurrentObservableCollection existingCollection, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(source, nameof(source)); + ArgumentNullException.ThrowIfNull(source); List list = await source.ToDatasyncListAsync(cancellationToken).ConfigureAwait(false); existingCollection.ReplaceAll(list); return existingCollection; diff --git a/src/CommunityToolkit.Datasync.Client/Query/Linq/FilterBuildingExpressionVisitor.cs b/src/CommunityToolkit.Datasync.Client/Query/Linq/FilterBuildingExpressionVisitor.cs index 74cf188..13e31a9 100644 --- a/src/CommunityToolkit.Datasync.Client/Query/Linq/FilterBuildingExpressionVisitor.cs +++ b/src/CommunityToolkit.Datasync.Client/Query/Linq/FilterBuildingExpressionVisitor.cs @@ -108,7 +108,7 @@ internal static QueryNode Compile(Expression filterExpression, JsonNamingPolicy /// the table member name internal static string GetTableMemberName(Expression expression, JsonNamingPolicy namingPolicy) { - ArgumentNullException.ThrowIfNull(expression, nameof(expression)); + ArgumentNullException.ThrowIfNull(expression); if (expression is MemberExpression member) { if (member.Expression.NodeType == ExpressionType.Parameter) diff --git a/src/CommunityToolkit.Datasync.Client/Query/Linq/QueryTranslator.cs b/src/CommunityToolkit.Datasync.Client/Query/Linq/QueryTranslator.cs index 38af3ee..ac47dd3 100644 --- a/src/CommunityToolkit.Datasync.Client/Query/Linq/QueryTranslator.cs +++ b/src/CommunityToolkit.Datasync.Client/Query/Linq/QueryTranslator.cs @@ -29,7 +29,7 @@ internal class QueryTranslator where T : class /// The to translate. internal QueryTranslator(IDatasyncQueryable query) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); + ArgumentNullException.ThrowIfNull(query); Query = query.Queryable; QueryDescription = new() { QueryParameters = query.QueryParameters, RequestTotalCount = query.RequestTotalCount }; NamingPolicy = ((DatasyncServiceClient)query.ServiceClient).JsonSerializerOptions.PropertyNamingPolicy; @@ -41,7 +41,7 @@ internal QueryTranslator(IDatasyncQueryable query) /// The to translate. internal QueryTranslator(IDatasyncPullQuery query) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); + ArgumentNullException.ThrowIfNull(query); Query = query.Queryable; QueryDescription = new() { QueryParameters = query.QueryParameters, RequestTotalCount = false }; NamingPolicy = DatasyncSerializer.JsonSerializerOptions.PropertyNamingPolicy; diff --git a/src/CommunityToolkit.Datasync.Client/Query/Linq/VisitorHelper.cs b/src/CommunityToolkit.Datasync.Client/Query/Linq/VisitorHelper.cs index f7f91e8..dfb252d 100644 --- a/src/CommunityToolkit.Datasync.Client/Query/Linq/VisitorHelper.cs +++ b/src/CommunityToolkit.Datasync.Client/Query/Linq/VisitorHelper.cs @@ -55,8 +55,8 @@ private VisitorHelper() /// public static Expression VisitAll(Expression expression, Func, Expression> visitor) { - ArgumentNullException.ThrowIfNull(expression, nameof(expression)); - ArgumentNullException.ThrowIfNull(visitor, nameof(visitor)); + ArgumentNullException.ThrowIfNull(expression); + ArgumentNullException.ThrowIfNull(visitor); return new VisitorHelper() { visitor = visitor }.Visit(expression); } @@ -73,8 +73,8 @@ public static Expression VisitAll(Expression expression, Func public static Expression VisitMembers(Expression expression, Func, Expression> visitor) { - ArgumentNullException.ThrowIfNull(expression, nameof(expression)); - ArgumentNullException.ThrowIfNull(visitor, nameof(visitor)); + ArgumentNullException.ThrowIfNull(expression); + ArgumentNullException.ThrowIfNull(visitor); return new VisitorHelper() { memberVisitor = visitor }.Visit(expression); } diff --git a/src/CommunityToolkit.Datasync.Client/Query/OData/ODataExpressionVisitor.cs b/src/CommunityToolkit.Datasync.Client/Query/OData/ODataExpressionVisitor.cs index be2fe8a..a060045 100644 --- a/src/CommunityToolkit.Datasync.Client/Query/OData/ODataExpressionVisitor.cs +++ b/src/CommunityToolkit.Datasync.Client/Query/OData/ODataExpressionVisitor.cs @@ -187,7 +187,7 @@ public override QueryNode Visit(UnaryOperatorNode node) /// The node to visit protected void Accept(QueryNode parent, QueryNode node) { - ArgumentNullException.ThrowIfNull(node, nameof(node)); + ArgumentNullException.ThrowIfNull(node); node.Accept(this); } } diff --git a/src/CommunityToolkit.Datasync.Client/Service/DatasyncServiceClient.cs b/src/CommunityToolkit.Datasync.Client/Service/DatasyncServiceClient.cs index 4016653..e83dc7c 100644 --- a/src/CommunityToolkit.Datasync.Client/Service/DatasyncServiceClient.cs +++ b/src/CommunityToolkit.Datasync.Client/Service/DatasyncServiceClient.cs @@ -61,8 +61,8 @@ public DatasyncServiceClient(Uri endpoint, HttpClient client, JsonSerializerOpti { endpoint = MakeAbsoluteUri(client.BaseAddress, endpoint); ThrowIf.IsNotValidEndpoint(endpoint, nameof(endpoint)); - ArgumentNullException.ThrowIfNull(client, nameof(client)); - ArgumentNullException.ThrowIfNull(serializerOptions, nameof(serializerOptions)); + ArgumentNullException.ThrowIfNull(client); + ArgumentNullException.ThrowIfNull(serializerOptions); Endpoint = endpoint; Client = client; @@ -107,8 +107,8 @@ public IReadOnlyDatasyncServiceClient ToServiceClient() where U : class /// Thrown if the entity already exists in the remote service dataset. public async ValueTask> AddAsync(TEntity entity, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(entity, nameof(entity)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(entity); + ArgumentNullException.ThrowIfNull(options); EntityMetadata metadata = EntityResolver.GetEntityMetadata(entity); ThrowIf.EntityIdIsInvalid(metadata.Id, nameof(metadata), because: "The value of the 'Id' property must be null or valid.", allowNull: true); @@ -143,8 +143,8 @@ public IDatasyncQueryable AsQueryable() /// The service response containing the count of entities that will be returned by the provided query. public async ValueTask> CountAsync(IDatasyncQueryable query, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(query); + ArgumentNullException.ThrowIfNull(options); QueryDescription queryDescription = new QueryTranslator(query).Translate(); // Make our query as efficient as possible for the specific task. @@ -170,8 +170,8 @@ public async ValueTask> CountAsync(IDatasyncQueryableThe service response containing the requested entity. public async ValueTask> GetAsync(string id, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(id, nameof(id)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(id); + ArgumentNullException.ThrowIfNull(options); ThrowIf.EntityIdIsInvalid(id, nameof(id), because: "The entity ID must be valid."); Uri requestUri = BuildUri(id, options); @@ -197,8 +197,8 @@ public async ValueTask> GetAsync(string id, DatasyncSer /// public async ValueTask>> GetPageAsync(string query, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(query); + ArgumentNullException.ThrowIfNull(options); Uri requestUri = new UriBuilder(Endpoint) { Query = query }.Uri; using HttpRequestMessage request = new(HttpMethod.Get, requestUri); @@ -235,8 +235,8 @@ public IDatasyncQueryable IncludeTotalCount(bool enabled = true) /// The service response containing the count of entities that will be returned by the provided query. public async ValueTask> LongCountAsync(IDatasyncQueryable query, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(query); + ArgumentNullException.ThrowIfNull(options); QueryDescription queryDescription = new QueryTranslator(query).Translate(); // Make our query as efficient as possible for the specific task. @@ -278,7 +278,7 @@ public IDatasyncQueryable OrderByDescending(ExpressionAn for the results that can be asynchronously iterated over. public IAsyncPageable Query(IDatasyncQueryable query) { - ArgumentNullException.ThrowIfNull(query, nameof(query)); + ArgumentNullException.ThrowIfNull(query); QueryDescription queryDescription = new QueryTranslator(query).Translate(); Uri requestUri = new UriBuilder(Endpoint) { Query = queryDescription.ToODataQueryString() }.Uri; return new FuncAsyncPageable((string? nextLink) => @@ -295,8 +295,8 @@ public IAsyncPageable Query(IDatasyncQueryable query) /// Thrown if a version is provided and does not match the service version in the remote service dataset. public async ValueTask RemoveAsync(string id, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(id, nameof(id)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(id); + ArgumentNullException.ThrowIfNull(options); ThrowIf.EntityIdIsInvalid(id, nameof(id), because: "The entity ID must be valid."); Uri requestUri = BuildUri(id, options); @@ -334,8 +334,8 @@ public async ValueTask RemoveAsync(string id, DatasyncServiceOp /// Thrown if a version is provided and does not match the service version in the remote service dataset. public async ValueTask> ReplaceAsync(TEntity entity, DatasyncServiceOptions options, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(entity, nameof(entity)); - ArgumentNullException.ThrowIfNull(options, nameof(options)); + ArgumentNullException.ThrowIfNull(entity); + ArgumentNullException.ThrowIfNull(options); EntityMetadata metadata = EntityResolver.GetEntityMetadata(entity); ThrowIf.EntityIdIsInvalid(metadata.Id, nameof(metadata), because: "The value of the 'Id' property must be null or valid."); @@ -501,7 +501,7 @@ internal bool IsNotFound(string id, ServiceResponse result, DatasyncServiceOptio /// A page of results from the service. internal async ValueTask> GetNextPageAsync(string queryOrContinuationToken, CancellationToken cancellationToken = default) { - ArgumentNullException.ThrowIfNull(queryOrContinuationToken, nameof(queryOrContinuationToken)); + ArgumentNullException.ThrowIfNull(queryOrContinuationToken); UriBuilder requestUriBuilder = new(Endpoint); if (queryOrContinuationToken.Contains('?')) { diff --git a/src/CommunityToolkit.Datasync.Client/Threading/QueueHandler.cs b/src/CommunityToolkit.Datasync.Client/Threading/QueueHandler.cs index 2cbe532..102ed92 100644 --- a/src/CommunityToolkit.Datasync.Client/Threading/QueueHandler.cs +++ b/src/CommunityToolkit.Datasync.Client/Threading/QueueHandler.cs @@ -21,9 +21,9 @@ internal class QueueHandler where T : class /// The job runner. public QueueHandler(int maxThreads, Func jobRunner) { - ArgumentOutOfRangeException.ThrowIfLessThan(maxThreads, 1, nameof(maxThreads)); - ArgumentOutOfRangeException.ThrowIfGreaterThan(maxThreads, 8, nameof(maxThreads)); - ArgumentNullException.ThrowIfNull(jobRunner, nameof(jobRunner)); + ArgumentOutOfRangeException.ThrowIfLessThan(maxThreads, 1); + ArgumentOutOfRangeException.ThrowIfGreaterThan(maxThreads, 8); + ArgumentNullException.ThrowIfNull(jobRunner); ExecutionDataflowBlockOptions options = new() { MaxDegreeOfParallelism = maxThreads }; this.jobs = new(jobRunner, options); } diff --git a/src/CommunityToolkit.Datasync.Server.InMemory/InMemoryRepository.cs b/src/CommunityToolkit.Datasync.Server.InMemory/InMemoryRepository.cs index f39eb18..e66706c 100644 --- a/src/CommunityToolkit.Datasync.Server.InMemory/InMemoryRepository.cs +++ b/src/CommunityToolkit.Datasync.Server.InMemory/InMemoryRepository.cs @@ -4,7 +4,6 @@ using CommunityToolkit.Datasync.Server.Abstractions.Http; using System.Collections.Concurrent; -using System.Text.Json; namespace CommunityToolkit.Datasync.Server.InMemory;