diff --git a/src/csharp/Grpc.Core.Api/AuthContext.cs b/src/csharp/Grpc.Core.Api/AuthContext.cs index fbec5001f6d..63a4b02020a 100644 --- a/src/csharp/Grpc.Core.Api/AuthContext.cs +++ b/src/csharp/Grpc.Core.Api/AuthContext.cs @@ -31,7 +31,7 @@ namespace Grpc.Core /// public class AuthContext { - string peerIdentityPropertyName; + string? peerIdentityPropertyName; Dictionary> properties; /// @@ -39,7 +39,7 @@ namespace Grpc.Core /// /// Peer identity property name. /// Multimap of auth properties by name. - public AuthContext(string peerIdentityPropertyName, Dictionary> properties) + public AuthContext(string? peerIdentityPropertyName, Dictionary> properties) { this.peerIdentityPropertyName = peerIdentityPropertyName; this.properties = GrpcPreconditions.CheckNotNull(properties); @@ -60,7 +60,7 @@ namespace Grpc.Core /// Gets the name of the property that indicates the peer identity. Returns null /// if the peer is not authenticated. /// - public string PeerIdentityPropertyName + public string? PeerIdentityPropertyName { get { diff --git a/src/csharp/Grpc.Core.Api/CallCredentials.cs b/src/csharp/Grpc.Core.Api/CallCredentials.cs index 47b84e03bfe..fd6e1510519 100644 --- a/src/csharp/Grpc.Core.Api/CallCredentials.cs +++ b/src/csharp/Grpc.Core.Api/CallCredentials.cs @@ -54,7 +54,7 @@ namespace Grpc.Core /// Populates call credentials configurator with this instance's configuration. /// End users never need to invoke this method as it is part of internal implementation. /// - public abstract void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state); + public abstract void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state); private class CompositeCallCredentials : CallCredentials { @@ -66,7 +66,7 @@ namespace Grpc.Core this.credentials = new List(credentials).AsReadOnly(); } - public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state) + public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state) { configurator.SetCompositeCredentials(state, credentials); } @@ -81,7 +81,7 @@ namespace Grpc.Core this.interceptor = GrpcPreconditions.CheckNotNull(interceptor); } - public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object state) + public override void InternalPopulateConfiguration(CallCredentialsConfiguratorBase configurator, object? state) { configurator.SetAsyncAuthInterceptorCredentials(state, interceptor); } diff --git a/src/csharp/Grpc.Core.Api/CallCredentialsConfiguratorBase.cs b/src/csharp/Grpc.Core.Api/CallCredentialsConfiguratorBase.cs index 51f8d729a11..c6525ecc896 100644 --- a/src/csharp/Grpc.Core.Api/CallCredentialsConfiguratorBase.cs +++ b/src/csharp/Grpc.Core.Api/CallCredentialsConfiguratorBase.cs @@ -29,11 +29,11 @@ namespace Grpc.Core /// /// Consumes configuration for composite call credentials. /// - public abstract void SetCompositeCredentials(object state, IReadOnlyList credentials); + public abstract void SetCompositeCredentials(object? state, IReadOnlyList credentials); /// /// Consumes configuration for call credentials created from AsyncAuthInterceptor /// - public abstract void SetAsyncAuthInterceptorCredentials(object state, AsyncAuthInterceptor interceptor); + public abstract void SetAsyncAuthInterceptorCredentials(object? state, AsyncAuthInterceptor interceptor); } } diff --git a/src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs b/src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs index ccf046851a0..b44eba02d02 100644 --- a/src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs +++ b/src/csharp/Grpc.Core.Api/IAsyncStreamWriter.cs @@ -42,6 +42,6 @@ namespace Grpc.Core /// Once set, this property maintains its value across subsequent /// writes. /// - WriteOptions WriteOptions { get; set; } + WriteOptions? WriteOptions { get; set; } } } diff --git a/src/csharp/Grpc.Core.Api/ServerCallContext.cs b/src/csharp/Grpc.Core.Api/ServerCallContext.cs index d560d234ea8..dd61e8b944d 100644 --- a/src/csharp/Grpc.Core.Api/ServerCallContext.cs +++ b/src/csharp/Grpc.Core.Api/ServerCallContext.cs @@ -97,7 +97,7 @@ namespace Grpc.Core /// For streaming response calls, this property is also exposed as on IServerStreamWriter for convenience. /// Both properties are backed by the same underlying value. /// - public WriteOptions WriteOptions + public WriteOptions? WriteOptions { get { @@ -143,7 +143,7 @@ namespace Grpc.Core /// Provides implementation of a non-virtual public member. protected abstract Status StatusCore { get; set; } /// Provides implementation of a non-virtual public member. - protected abstract WriteOptions WriteOptionsCore { get; set; } + protected abstract WriteOptions? WriteOptionsCore { get; set; } /// Provides implementation of a non-virtual public member. protected abstract AuthContext AuthContextCore { get; } /// Provides implementation of a non-virtual public member.