Skip to content

Commit 221aec7

Browse files
committed
Update SDK to preview 3
1 parent c234463 commit 221aec7

File tree

40 files changed

+523
-366
lines changed

40 files changed

+523
-366
lines changed

build/dependencies.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<MicrosoftAspNetCoreApp31PackageVersion>3.1.3</MicrosoftAspNetCoreApp31PackageVersion>
1313
<MicrosoftBuildLocatorPackageVersion>1.5.5</MicrosoftBuildLocatorPackageVersion>
1414
<MicrosoftBuildPackageVersion>16.9.0</MicrosoftBuildPackageVersion>
15-
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>7.0.0-preview1.22518.1</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
15+
<MicrosoftCodeAnalysisNetAnalyzersPackageVersion>8.0.0-preview1.23165.1</MicrosoftCodeAnalysisNetAnalyzersPackageVersion>
1616
<MicrosoftCrankEventSourcesPackageVersion>0.2.0-alpha.21255.1</MicrosoftCrankEventSourcesPackageVersion>
1717
<MicrosoftExtensionsLoggingTestingPackageVersion>2.1.1</MicrosoftExtensionsLoggingTestingPackageVersion>
1818
<MicrosoftExtensionsPackageVersion>7.0.0</MicrosoftExtensionsPackageVersion>

global.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"sdk": {
3-
"version": "8.0.100-preview.3.23164.23"
3+
"version": "8.0.100-preview.3.23178.7"
44
}
55
}

src/Grpc.AspNetCore.HealthChecks/Grpc.AspNetCore.HealthChecks.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Integration of ASP.NET Core health checks with Grpc.HealthCheck</Description>
@@ -18,6 +18,8 @@
1818

1919
<ProjectReference Include="..\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
2020
<ProjectReference Include="..\Grpc.HealthCheck\Grpc.HealthCheck.csproj" />
21+
22+
<Compile Include="..\Shared\ThrowHelpers\ArgumentNullThrowHelper.cs" Link="Internal\ArgumentNullThrowHelper.cs" />
2123
</ItemGroup>
2224

2325
</Project>

src/Grpc.AspNetCore.HealthChecks/GrpcHealthChecksEndpointRouteBuilderExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Copyright notice and license
1+
#region Copyright notice and license
22

33
// Copyright 2019 The gRPC Authors
44
//
@@ -17,6 +17,7 @@
1717
#endregion
1818

1919
using Grpc.AspNetCore.HealthChecks.Internal;
20+
using Grpc.Shared;
2021
using Microsoft.AspNetCore.Routing;
2122

2223
namespace Microsoft.AspNetCore.Builder;
@@ -34,10 +35,7 @@ public static class GrpcHealthChecksEndpointRouteBuilderExtensions
3435
/// <returns>An <see cref="GrpcServiceEndpointConventionBuilder"/> for endpoints associated with the service.</returns>
3536
public static GrpcServiceEndpointConventionBuilder MapGrpcHealthChecksService(this IEndpointRouteBuilder builder)
3637
{
37-
if (builder == null)
38-
{
39-
throw new ArgumentNullException(nameof(builder));
40-
}
38+
ArgumentNullThrowHelper.ThrowIfNull(builder);
4139

4240
return builder.MapGrpcService<HealthServiceIntegration>();
4341
}

src/Grpc.AspNetCore.HealthChecks/GrpcHealthChecksServiceExtensions.cs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Copyright notice and license
1+
#region Copyright notice and license
22

33
// Copyright 2019 The gRPC Authors
44
//
@@ -18,8 +18,10 @@
1818

1919
using Grpc.AspNetCore.HealthChecks;
2020
using Grpc.HealthCheck;
21+
using Grpc.Shared;
2122
using Microsoft.Extensions.DependencyInjection.Extensions;
2223
using Microsoft.Extensions.Diagnostics.HealthChecks;
24+
using Microsoft.Extensions.Options;
2325

2426
namespace Microsoft.Extensions.DependencyInjection;
2527

@@ -35,10 +37,7 @@ public static class GrpcHealthChecksServiceExtensions
3537
/// <returns>An instance of <see cref="IHealthChecksBuilder"/> from which health checks can be registered.</returns>
3638
public static IHealthChecksBuilder AddGrpcHealthChecks(this IServiceCollection services)
3739
{
38-
if (services == null)
39-
{
40-
throw new ArgumentNullException(nameof(services));
41-
}
40+
ArgumentNullThrowHelper.ThrowIfNull(services);
4241

4342
return AddGrpcHealthChecksCore(services);
4443
}
@@ -51,15 +50,8 @@ public static IHealthChecksBuilder AddGrpcHealthChecks(this IServiceCollection s
5150
/// <returns>An instance of <see cref="IHealthChecksBuilder"/> from which health checks can be registered.</returns>
5251
public static IHealthChecksBuilder AddGrpcHealthChecks(this IServiceCollection services, Action<GrpcHealthChecksOptions> configure)
5352
{
54-
if (services == null)
55-
{
56-
throw new ArgumentNullException(nameof(services));
57-
}
58-
59-
if (configure == null)
60-
{
61-
throw new ArgumentNullException(nameof(configure));
62-
}
53+
ArgumentNullThrowHelper.ThrowIfNull(services);
54+
ArgumentNullThrowHelper.ThrowIfNull(configure);
6355

6456
var builder = AddGrpcHealthChecksCore(services);
6557

src/Grpc.AspNetCore.Server.ClientFactory/Grpc.AspNetCore.Server.ClientFactory.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>HttpClientFactory integration the for gRPC .NET client when running in ASP.NET Core</Description>
@@ -19,5 +19,7 @@
1919
<ProjectReference Include="..\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
2020
<!-- PrivateAssets set to None to ensure the build targets/props are propagated to parent project -->
2121
<ProjectReference Include="..\Grpc.Net.ClientFactory\Grpc.Net.ClientFactory.csproj" PrivateAssets="None" />
22+
23+
<Compile Include="..\Shared\ThrowHelpers\ArgumentNullThrowHelper.cs" Link="Internal\ArgumentNullThrowHelper.cs" />
2224
</ItemGroup>
2325
</Project>

src/Grpc.AspNetCore.Server.ClientFactory/GrpcServerHttpClientBuilderExtensions.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Copyright notice and license
1+
#region Copyright notice and license
22

33
// Copyright 2019 The gRPC Authors
44
//
@@ -19,6 +19,7 @@
1919
using Grpc.AspNetCore.ClientFactory;
2020
using Grpc.Core;
2121
using Grpc.Net.ClientFactory;
22+
using Grpc.Shared;
2223
using Microsoft.AspNetCore.Http;
2324
using Microsoft.Extensions.Logging;
2425
using Microsoft.Extensions.Options;
@@ -38,10 +39,7 @@ public static class GrpcServerHttpClientBuilderExtensions
3839
/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns>
3940
public static IHttpClientBuilder EnableCallContextPropagation(this IHttpClientBuilder builder)
4041
{
41-
if (builder == null)
42-
{
43-
throw new ArgumentNullException(nameof(builder));
44-
}
42+
ArgumentNullThrowHelper.ThrowIfNull(builder);
4543

4644
EnableCallContextPropagationCore(builder, new GrpcContextPropagationOptions());
4745

@@ -57,15 +55,8 @@ public static IHttpClientBuilder EnableCallContextPropagation(this IHttpClientBu
5755
/// <returns>An <see cref="IHttpClientBuilder"/> that can be used to configure the client.</returns>
5856
public static IHttpClientBuilder EnableCallContextPropagation(this IHttpClientBuilder builder, Action<GrpcContextPropagationOptions> configureOptions)
5957
{
60-
if (builder == null)
61-
{
62-
throw new ArgumentNullException(nameof(builder));
63-
}
64-
65-
if (configureOptions == null)
66-
{
67-
throw new ArgumentNullException(nameof(configureOptions));
68-
}
58+
ArgumentNullThrowHelper.ThrowIfNull(builder);
59+
ArgumentNullThrowHelper.ThrowIfNull(configureOptions);
6960

7061
var options = new GrpcContextPropagationOptions();
7162
configureOptions(options);

src/Grpc.AspNetCore.Server.Reflection/Grpc.AspNetCore.Server.Reflection.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Description>Automatic discovery of services for Grpc.Reflection</Description>
@@ -19,6 +19,8 @@
1919

2020
<ProjectReference Include="..\Grpc.AspNetCore.Server\Grpc.AspNetCore.Server.csproj" />
2121
<ProjectReference Include="..\Grpc.Reflection\Grpc.Reflection.csproj" />
22+
23+
<Compile Include="..\Shared\ThrowHelpers\ArgumentNullThrowHelper.cs" Link="Internal\ArgumentNullThrowHelper.cs" />
2224
</ItemGroup>
2325

2426
</Project>

src/Grpc.AspNetCore.Server.Reflection/GrpcReflectionEndpointRouteBuilderExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Copyright notice and license
1+
#region Copyright notice and license
22

33
// Copyright 2019 The gRPC Authors
44
//
@@ -17,6 +17,7 @@
1717
#endregion
1818

1919
using Grpc.Reflection;
20+
using Grpc.Shared;
2021
using Microsoft.AspNetCore.Routing;
2122
using Microsoft.Extensions.DependencyInjection;
2223

@@ -35,10 +36,7 @@ public static class GrpcReflectionEndpointRouteBuilderExtensions
3536
/// <returns>An <see cref="IEndpointConventionBuilder"/> for endpoints associated with the service.</returns>
3637
public static IEndpointConventionBuilder MapGrpcReflectionService(this IEndpointRouteBuilder builder)
3738
{
38-
if (builder == null)
39-
{
40-
throw new ArgumentNullException(nameof(builder));
41-
}
39+
ArgumentNullThrowHelper.ThrowIfNull(builder);
4240

4341
ValidateServicesRegistered(builder.ServiceProvider);
4442

src/Grpc.AspNetCore.Server.Reflection/GrpcReflectionServiceExtensions.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Copyright notice and license
1+
#region Copyright notice and license
22

33
// Copyright 2019 The gRPC Authors
44
//
@@ -21,6 +21,7 @@
2121
using Grpc.AspNetCore.Server;
2222
using Grpc.Core;
2323
using Grpc.Reflection;
24+
using Grpc.Shared;
2425
using Microsoft.AspNetCore.Routing;
2526
using Microsoft.Extensions.DependencyInjection.Extensions;
2627
using Microsoft.Extensions.Logging;
@@ -39,10 +40,7 @@ public static class GrpcReflectionServiceExtensions
3940
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained.</returns>
4041
public static IServiceCollection AddGrpcReflection(this IServiceCollection services)
4142
{
42-
if (services == null)
43-
{
44-
throw new ArgumentNullException(nameof(services));
45-
}
43+
ArgumentNullThrowHelper.ThrowIfNull(services);
4644

4745
services.TryAddSingleton<GrpcReflectionMarkerService>();
4846

0 commit comments

Comments
 (0)