Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the array to IReadOnlyList since it is a public API #3418

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.Generator.CSharp.ClientModel.Expressions;
using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Input;
using Microsoft.Generator.CSharp.Writers;

namespace Microsoft.Generator.CSharp.ClientModel
Expand All @@ -30,10 +30,10 @@ public class ClientModelPlugin : CodeModelPlugin
/// Returns the serialization type providers for the given model type provider.
/// </summary>
/// <param name="provider">The model type provider.</param>
public override TypeProvider[] GetSerializationTypeProviders(ModelTypeProvider provider)
public override IReadOnlyList<TypeProvider> GetSerializationTypeProviders(ModelTypeProvider provider)
{
// Add JSON serialization type provider
return new TypeProvider[] { new MrwSerializationTypeProvider(provider) };
return [new MrwSerializationTypeProvider(provider)];
}

[ImportingConstructor]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Microsoft.Generator.CSharp.Expressions;
using Microsoft.Generator.CSharp.Input;
Expand Down Expand Up @@ -43,6 +44,6 @@ public CodeModelPlugin(GeneratorContext context)
/// Returns a serialization type provider for the given model type provider.
/// </summary>
/// <param name="provider">The model type provider.</param>
public abstract TypeProvider[] GetSerializationTypeProviders(ModelTypeProvider provider);
public abstract IReadOnlyList<TypeProvider> GetSerializationTypeProviders(ModelTypeProvider provider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public sealed class ModelTypeProvider : TypeProvider
/// <summary>
/// The serializations providers for the model provider.
/// </summary>
public TypeProvider[] SerializationProviders { get; } = Array.Empty<TypeProvider>();
public IReadOnlyList<TypeProvider> SerializationProviders { get; } = Array.Empty<TypeProvider>();

public ModelTypeProvider(InputModelType inputModel, SourceInputModel? sourceInputModel)
: base(sourceInputModel)
Expand Down
Loading