Skip to content

Commit 16ae780

Browse files
author
Bart Koelman
committed
Reformat solution
1 parent 3ca0047 commit 16ae780

File tree

75 files changed

+156
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+156
-243
lines changed

benchmarks/Deserialization/DeserializationBenchmarkBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ protected DeserializationBenchmarkBase()
2828
var resourceDefinitionAccessor = new ResourceDefinitionAccessor(resourceGraph, serviceContainer);
2929

3030
serviceContainer.AddService(typeof(IResourceDefinitionAccessor), resourceDefinitionAccessor);
31-
32-
serviceContainer.AddService(typeof(IResourceDefinition<IncomingResource, int>),
33-
new JsonApiResourceDefinition<IncomingResource, int>(resourceGraph));
31+
serviceContainer.AddService(typeof(IResourceDefinition<IncomingResource, int>), new JsonApiResourceDefinition<IncomingResource, int>(resourceGraph));
3432

3533
// ReSharper disable once VirtualMemberCallInConstructor
3634
JsonApiRequest request = CreateJsonApiRequest(resourceGraph);

benchmarks/QueryString/QueryStringParserBenchmarks.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ public QueryStringParserBenchmarks()
2828
EnableLegacyFilterNotation = true
2929
};
3030

31-
IResourceGraph resourceGraph =
32-
new ResourceGraphBuilder(options, NullLoggerFactory.Instance).Add<QueryableResource, int>("alt-resource-name").Build();
31+
IResourceGraph resourceGraph = new ResourceGraphBuilder(options, NullLoggerFactory.Instance).Add<QueryableResource, int>("alt-resource-name").Build();
3332

3433
var request = new JsonApiRequest
3534
{

benchmarks/Serialization/SerializationBenchmarkBase.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ public Task OnPrepareWriteAsync<TResource>(TResource resource, WriteOperationKin
173173
return Task.FromResult(rightResourceId);
174174
}
175175

176-
public Task OnSetToManyRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship,
177-
ISet<IIdentifiable> rightResourceIds, WriteOperationKind writeOperation, CancellationToken cancellationToken)
176+
public Task OnSetToManyRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds,
177+
WriteOperationKind writeOperation, CancellationToken cancellationToken)
178178
where TResource : class, IIdentifiable
179179
{
180180
return Task.CompletedTask;
@@ -187,8 +187,8 @@ public Task OnAddToRelationshipAsync<TResource, TId>(TId leftResourceId, HasMany
187187
return Task.CompletedTask;
188188
}
189189

190-
public Task OnRemoveFromRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship,
191-
ISet<IIdentifiable> rightResourceIds, CancellationToken cancellationToken)
190+
public Task OnRemoveFromRelationshipAsync<TResource>(TResource leftResource, HasManyAttribute hasManyRelationship, ISet<IIdentifiable> rightResourceIds,
191+
CancellationToken cancellationToken)
192192
where TResource : class, IIdentifiable
193193
{
194194
return Task.CompletedTask;

src/Examples/GettingStarted/GettingStarted.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
<ItemGroup>
77
<ProjectReference Include="..\..\JsonApiDotNetCore\JsonApiDotNetCore.csproj" />
8-
<ProjectReference Include="..\..\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
8+
<ProjectReference Include="..\..\JsonApiDotNetCore.SourceGenerators\JsonApiDotNetCore.SourceGenerators.csproj" OutputItemType="Analyzer"
9+
ReferenceOutputAssembly="false" />
910
</ItemGroup>
1011

1112
<ItemGroup>

src/JsonApiDotNetCore/Configuration/JsonApiOptions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ public sealed class JsonApiOptions : IJsonApiOptions
104104

105105
public JsonApiOptions()
106106
{
107-
_lazySerializerReadOptions =
108-
new Lazy<JsonSerializerOptions>(() => new JsonSerializerOptions(SerializerOptions), LazyThreadSafetyMode.PublicationOnly);
107+
_lazySerializerReadOptions = new Lazy<JsonSerializerOptions>(() => new JsonSerializerOptions(SerializerOptions), LazyThreadSafetyMode.PublicationOnly);
109108

110109
_lazySerializerWriteOptions = new Lazy<JsonSerializerOptions>(() => new JsonSerializerOptions(SerializerOptions)
111110
{

src/JsonApiDotNetCore/Configuration/ResourceGraph.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ private IEnumerable<string> ToMemberNames<TResource>(Expression<Func<TResource,
178178
}
179179
else
180180
{
181-
throw new ArgumentException(
182-
$"The expression '{selector}' should select a single property or select multiple properties into an anonymous type. " +
181+
throw new ArgumentException($"The expression '{selector}' should select a single property or select multiple properties into an anonymous type. " +
183182
"For example: 'article => article.Title' or 'article => new { article.Title, article.PageCount }'.");
184183
}
185184
}

src/JsonApiDotNetCore/Configuration/ResourceGraphBuilder.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@ private void AssertNoDuplicatePublicName(ResourceType resourceType, string effec
289289

290290
if (existingClrType != null)
291291
{
292-
throw new InvalidConfigurationException(
293-
$"Resource '{existingClrType}' and '{resourceType.ClrType}' both use public name '{effectivePublicName}'.");
292+
throw new InvalidConfigurationException($"Resource '{existingClrType}' and '{resourceType.ClrType}' both use public name '{effectivePublicName}'.");
294293
}
295294
}
296295

@@ -328,8 +327,8 @@ private static void AssertNoInfiniteRecursion(int recursionDepth)
328327

329328
private Type TypeOrElementType(Type type)
330329
{
331-
Type[] interfaces = type.GetInterfaces()
332-
.Where(@interface => @interface.IsGenericType && @interface.GetGenericTypeDefinition() == typeof(IEnumerable<>)).ToArray();
330+
Type[] interfaces = type.GetInterfaces().Where(@interface => @interface.IsGenericType && @interface.GetGenericTypeDefinition() == typeof(IEnumerable<>))
331+
.ToArray();
333332

334333
return interfaces.Length == 1 ? interfaces.Single().GenericTypeArguments[0] : type;
335334
}

src/JsonApiDotNetCore/Configuration/ResourceType.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ public AttrAttribute GetAttributeByPropertyName(string propertyName)
119119
{
120120
AttrAttribute? attribute = FindAttributeByPropertyName(propertyName);
121121

122-
return attribute ??
123-
throw new InvalidOperationException($"Attribute for property '{propertyName}' does not exist on resource type '{ClrType.Name}'.");
122+
return attribute ?? throw new InvalidOperationException($"Attribute for property '{propertyName}' does not exist on resource type '{ClrType.Name}'.");
124123
}
125124

126125
public AttrAttribute? FindAttributeByPropertyName(string propertyName)

src/JsonApiDotNetCore/Configuration/ServiceDiscoveryFacade.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ private void RegisterImplementations(Assembly assembly, Type interfaceType, Reso
158158
? ArrayFactory.Create(resourceDescriptor.ResourceClrType, resourceDescriptor.IdClrType)
159159
: ArrayFactory.Create(resourceDescriptor.ResourceClrType);
160160

161-
(Type implementation, Type registrationInterface)? result =
162-
_typeLocator.GetGenericInterfaceImplementation(assembly, interfaceType, genericArguments);
161+
(Type implementation, Type registrationInterface)? result = _typeLocator.GetGenericInterfaceImplementation(assembly, interfaceType, genericArguments);
163162

164163
if (result != null)
165164
{

src/JsonApiDotNetCore/Configuration/TypeLocator.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ internal sealed class TypeLocator
6161
ArgumentGuard.NotNull(openGenericInterface, nameof(openGenericInterface));
6262
ArgumentGuard.NotNull(interfaceGenericTypeArguments, nameof(interfaceGenericTypeArguments));
6363

64-
if (!openGenericInterface.IsInterface || !openGenericInterface.IsGenericType ||
65-
openGenericInterface != openGenericInterface.GetGenericTypeDefinition())
64+
if (!openGenericInterface.IsInterface || !openGenericInterface.IsGenericType || openGenericInterface != openGenericInterface.GetGenericTypeDefinition())
6665
{
67-
throw new ArgumentException($"Specified type '{openGenericInterface.FullName}' is not an open generic interface.",
68-
nameof(openGenericInterface));
66+
throw new ArgumentException($"Specified type '{openGenericInterface.FullName}' is not an open generic interface.", nameof(openGenericInterface));
6967
}
7068

7169
if (interfaceGenericTypeArguments.Length != openGenericInterface.GetGenericArguments().Length)

0 commit comments

Comments
 (0)