Skip to content

Commit d1f8362

Browse files
committed
Cleanups
1 parent fcdc1bf commit d1f8362

11 files changed

+31
-32
lines changed

src/Components/Endpoints/src/Binding/Converters/DictionaryAdapters/DictionaryBufferAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
55

66
// Uses a concrete type that implements IDictionary<TKey, TValue> as a buffer.
7-
internal class DictionaryBufferAdapter<TDictionaryType, TKey, TValue>
7+
internal sealed class DictionaryBufferAdapter<TDictionaryType, TKey, TValue>
88
: IDictionaryBufferAdapter<TDictionaryType, TDictionaryType, TKey, TValue>
99
where TDictionaryType : IDictionary<TKey, TValue>, new()
1010
where TKey : IParsable<TKey>

src/Components/Endpoints/src/Binding/Converters/DictionaryAdapters/DictionaryStaticCastAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
55

66
// Adapts a concrete dictionary type into an interface.
7-
internal class DictionaryStaticCastAdapter<TDictionaryInterface, TDictionaryImplementation, TDictionaryAdapter, TBuffer, TKey, TValue>
7+
internal sealed class DictionaryStaticCastAdapter<TDictionaryInterface, TDictionaryImplementation, TDictionaryAdapter, TBuffer, TKey, TValue>
88
: IDictionaryBufferAdapter<TDictionaryInterface, TBuffer, TKey, TValue>
99
where TDictionaryAdapter : IDictionaryBufferAdapter<TDictionaryImplementation, TBuffer, TKey, TValue>
1010
where TDictionaryImplementation : TDictionaryInterface

src/Components/Endpoints/src/Binding/Converters/DictionaryAdapters/ImmutableDictionaryBufferAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Collections.Immutable;
55

66
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
77

8-
internal class ImmutableDictionaryBufferAdapter<TKey, TValue>
8+
internal sealed class ImmutableDictionaryBufferAdapter<TKey, TValue>
99
: IDictionaryBufferAdapter<ImmutableDictionary<TKey, TValue>, ImmutableDictionary<TKey, TValue>.Builder, TKey, TValue>
1010
where TKey : IParsable<TKey>
1111
{

src/Components/Endpoints/src/Binding/Converters/DictionaryAdapters/ImmutableSortedDictionaryBufferAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Collections.Immutable;
55

66
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
77

8-
internal class ImmutableSortedDictionaryBufferAdapter<TKey, TValue>
8+
internal sealed class ImmutableSortedDictionaryBufferAdapter<TKey, TValue>
99
: IDictionaryBufferAdapter<ImmutableSortedDictionary<TKey, TValue>, ImmutableSortedDictionary<TKey, TValue>.Builder, TKey, TValue>
1010
where TKey : IParsable<TKey>
1111
{

src/Components/Endpoints/src/Binding/Converters/DictionaryAdapters/ReadOnlyDictionaryBufferAdapter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using System.Collections.ObjectModel;
55

66
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
77

8-
internal class ReadOnlyDictionaryBufferAdapter<TKey, TValue>
8+
internal sealed class ReadOnlyDictionaryBufferAdapter<TKey, TValue>
99
: IDictionaryBufferAdapter<ReadOnlyDictionary<TKey, TValue>, Dictionary<TKey, TValue>, TKey, TValue>
1010
where TKey : IParsable<TKey>
1111
{

src/Components/Endpoints/src/Binding/Converters/DictionaryConverter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal abstract class DictionaryConverter<TDictionary> : FormDataConverter<TDi
99
{
1010
}
1111

12-
internal class DictionaryConverter<TDictionary, TDictionaryPolicy, TBuffer, TKey, TValue> : DictionaryConverter<TDictionary>
12+
internal sealed class DictionaryConverter<TDictionary, TDictionaryPolicy, TBuffer, TKey, TValue> : DictionaryConverter<TDictionary>
1313
where TKey : IParsable<TKey>
1414
where TDictionaryPolicy : IDictionaryBufferAdapter<TDictionary, TBuffer, TKey, TValue>
1515
{
@@ -25,7 +25,7 @@ public DictionaryConverter(FormDataConverter<TValue> elementConverter)
2525
internal override bool TryRead(
2626
ref FormDataReader context,
2727
Type type,
28-
FormDataSerializerOptions options,
28+
FormDataMapperOptions options,
2929
[NotNullWhen(true)] out TDictionary? result,
3030
out bool found)
3131
{

src/Components/Endpoints/src/Binding/Factories/Collections/ConcreteTypeCollectionConverterFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ internal class ConcreteTypeCollectionConverterFactory<TCollection, TElement>
99
public static readonly ConcreteTypeCollectionConverterFactory<TCollection, TElement> Instance =
1010
new();
1111

12-
public bool CanConvert(Type _, FormDataSerializerOptions options) => true;
12+
public bool CanConvert(Type _, FormDataMapperOptions options) => true;
1313

14-
public FormDataConverter CreateConverter(Type _, FormDataSerializerOptions options)
14+
public FormDataConverter CreateConverter(Type _, FormDataMapperOptions options)
1515
{
1616
// Resolve the element type converter
1717
var elementTypeConverter = options.ResolveConverter<TElement>() ??

src/Components/Endpoints/src/Binding/Factories/Dictionary/ConcreteTypeDictionaryConverterFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33

44
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
55

6-
internal class ConcreteTypeDictionaryConverterFactory<TDictionary, TKey, TValue> : IFormDataConverterFactory
6+
internal sealed class ConcreteTypeDictionaryConverterFactory<TDictionary, TKey, TValue> : IFormDataConverterFactory
77
where TKey : IParsable<TKey>
88
{
99
public static readonly ConcreteTypeDictionaryConverterFactory<TDictionary, TKey, TValue> Instance = new();
1010

11-
public bool CanConvert(Type type, FormDataSerializerOptions options) => true;
11+
public bool CanConvert(Type type, FormDataMapperOptions options) => true;
1212

13-
public FormDataConverter CreateConverter(Type type, FormDataSerializerOptions options)
13+
public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
1414
{
1515
// Resolve the element type converter
1616
var keyConverter = options.ResolveConverter<TKey>() ??

src/Components/Endpoints/src/Binding/Factories/Dictionary/TypedDictionaryConverterFactory.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
namespace Microsoft.AspNetCore.Components.Endpoints.Binding;
99

10-
internal class TypedDictionaryConverterFactory<TDictionaryType, TKey, TValue> : IFormDataConverterFactory
10+
internal sealed class TypedDictionaryConverterFactory<TDictionaryType, TKey, TValue> : IFormDataConverterFactory
1111
where TKey : IParsable<TKey>
1212
{
13-
public bool CanConvert(Type type, FormDataSerializerOptions options)
13+
public bool CanConvert(Type type, FormDataMapperOptions options)
1414
{
1515
// Resolve the value type converter
1616
var valueTypeConverter = options.ResolveConverter<TValue>();
@@ -70,7 +70,7 @@ var _ when type.IsAssignableTo(typeof(IDictionary<TKey, TValue>)) && type.GetCon
7070
return false;
7171
}
7272

73-
public FormDataConverter CreateConverter(Type type, FormDataSerializerOptions options)
73+
public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
7474
{
7575
// Resolve the value type converter
7676
var valueTypeConverter = options.ResolveConverter<TValue>();

src/Components/Endpoints/src/Binding/Factories/DictionaryConverterFactory.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ internal class DictionaryConverterFactory : IFormDataConverterFactory
99
{
1010
internal static readonly DictionaryConverterFactory Instance = new();
1111

12-
public bool CanConvert(Type type, FormDataSerializerOptions options)
12+
public bool CanConvert(Type type, FormDataMapperOptions options)
1313
{
1414
// Well-known dictionary types
1515
// IDictionary<TKey, TValue>
@@ -68,7 +68,7 @@ public bool CanConvert(Type type, FormDataSerializerOptions options)
6868
return factory.CanConvert(type, options);
6969
}
7070

71-
public FormDataConverter CreateConverter(Type type, FormDataSerializerOptions options)
71+
public FormDataConverter CreateConverter(Type type, FormDataMapperOptions options)
7272
{
7373
// Type must implement IDictionary<TKey, TValue> IReadOnlyDictionary<TKey, TValue>
7474
// Note that IDictionary doesn't extend IReadOnlyDictionary, hence the need for two checks

0 commit comments

Comments
 (0)