Skip to content

Apply remaining gRPC API changes #42422

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

Merged
merged 1 commit into from
Jun 27, 2022
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 @@ -17,34 +17,34 @@ public static class GrpcJsonTranscodingServiceExtensions
/// <summary>
/// Adds gRPC JSON transcoding services to the specified <see cref="IGrpcServerBuilder" />.
/// </summary>
/// <param name="grpcBuilder">The <see cref="IGrpcServerBuilder"/>.</param>
/// <param name="builder">The <see cref="IGrpcServerBuilder"/>.</param>
/// <returns>The same instance of the <see cref="IGrpcServerBuilder"/> for chaining.</returns>
public static IGrpcServerBuilder AddJsonTranscoding(this IGrpcServerBuilder grpcBuilder)
public static IGrpcServerBuilder AddJsonTranscoding(this IGrpcServerBuilder builder)
{
if (grpcBuilder == null)
if (builder == null)
{
throw new ArgumentNullException(nameof(grpcBuilder));
throw new ArgumentNullException(nameof(builder));
}

grpcBuilder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IServiceMethodProvider<>), typeof(JsonTranscodingServiceMethodProvider<>)));
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton(typeof(IServiceMethodProvider<>), typeof(JsonTranscodingServiceMethodProvider<>)));

return grpcBuilder;
return builder;
}

/// <summary>
/// Adds gRPC JSON transcoding services to the specified <see cref="IGrpcServerBuilder" />.
/// </summary>
/// <param name="grpcBuilder">The <see cref="IGrpcServerBuilder"/>.</param>
/// <param name="builder">The <see cref="IGrpcServerBuilder"/>.</param>
/// <param name="configureOptions">An <see cref="Action{GrpcJsonTranscodingOptions}"/> to configure the provided <see cref="GrpcJsonTranscodingOptions"/>.</param>
/// <returns>The same instance of the <see cref="IGrpcServerBuilder"/> for chaining.</returns>
public static IGrpcServerBuilder AddJsonTranscoding(this IGrpcServerBuilder grpcBuilder, Action<GrpcJsonTranscodingOptions> configureOptions)
public static IGrpcServerBuilder AddJsonTranscoding(this IGrpcServerBuilder builder, Action<GrpcJsonTranscodingOptions> configureOptions)
{
if (grpcBuilder == null)
if (builder == null)
{
throw new ArgumentNullException(nameof(grpcBuilder));
throw new ArgumentNullException(nameof(builder));
}

grpcBuilder.Services.Configure(configureOptions);
return grpcBuilder.AddJsonTranscoding();
builder.Services.Configure(configureOptions);
return builder.AddJsonTranscoding();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ Microsoft.AspNetCore.Grpc.JsonTranscoding.GrpcJsonTranscodingOptions.JsonSetting
Microsoft.AspNetCore.Grpc.JsonTranscoding.GrpcJsonTranscodingOptions.TypeRegistry.get -> Google.Protobuf.Reflection.TypeRegistry!
Microsoft.AspNetCore.Grpc.JsonTranscoding.GrpcJsonTranscodingOptions.TypeRegistry.set -> void
Microsoft.Extensions.DependencyInjection.GrpcJsonTranscodingServiceExtensions
static Microsoft.Extensions.DependencyInjection.GrpcJsonTranscodingServiceExtensions.AddJsonTranscoding(this Grpc.AspNetCore.Server.IGrpcServerBuilder! grpcBuilder) -> Grpc.AspNetCore.Server.IGrpcServerBuilder!
static Microsoft.Extensions.DependencyInjection.GrpcJsonTranscodingServiceExtensions.AddJsonTranscoding(this Grpc.AspNetCore.Server.IGrpcServerBuilder! grpcBuilder, System.Action<Microsoft.AspNetCore.Grpc.JsonTranscoding.GrpcJsonTranscodingOptions!>! configureOptions) -> Grpc.AspNetCore.Server.IGrpcServerBuilder!
static Microsoft.Extensions.DependencyInjection.GrpcJsonTranscodingServiceExtensions.AddJsonTranscoding(this Grpc.AspNetCore.Server.IGrpcServerBuilder! builder) -> Grpc.AspNetCore.Server.IGrpcServerBuilder!
static Microsoft.Extensions.DependencyInjection.GrpcJsonTranscodingServiceExtensions.AddJsonTranscoding(this Grpc.AspNetCore.Server.IGrpcServerBuilder! builder, System.Action<Microsoft.AspNetCore.Grpc.JsonTranscoding.GrpcJsonTranscodingOptions!>! configureOptions) -> Grpc.AspNetCore.Server.IGrpcServerBuilder!