FromCallCredentials() public static method

Creates a CallSettings for the specified call credentials, or returns null if credentials is null.
public static FromCallCredentials ( Grpc.Core.CallCredentials credentials ) : CallSettings
credentials Grpc.Core.CallCredentials The call credentials for the new settings.
return CallSettings
Exemplo n.º 1
0
 /// <summary>
 /// Returns a new <see cref="CallSettings"/> with the specified call credentials,
 /// merged with the (optional) original settings specified by <paramref name="settings"/>.
 /// </summary>
 /// <param name="settings">Original settings. May be null, in which case the returned settings
 /// will only contain call credentials.</param>
 /// <param name="credentials">Call credentials for the new call settings.
 /// This may be null, in which case any call credentials in <paramref name="settings"/> are
 /// not present in the new call settings. If both this and <paramref name="settings"/> are null,
 /// the return value is null.</param>
 /// <returns>A new set of call settings, or null if both parameters are null.</returns>
 public static CallSettings WithCallCredentials(
     this CallSettings settings,
     CallCredentials credentials) =>
 settings == null
         ? CallSettings.FromCallCredentials(credentials)
         : new CallSettings(settings.CancellationToken, credentials,
                            settings.Timing, settings.HeaderMutation,
                            settings.WriteOptions, settings.PropagationToken);
Exemplo n.º 2
0
 public static CallSettings WithCallCredentials(
     this CallSettings settings,
     CallCredentials credentials) =>
 settings == null
         ? CallSettings.FromCallCredentials(credentials)
         : new CallSettings(settings.CancellationToken, credentials,
                            settings.Expiration, settings.Retry, settings.HeaderMutation,
                            settings.WriteOptions, settings.PropagationToken,
                            settings.ResponseMetadataHandler, settings.TrailingMetadataHandler);