Skip to content
Snippets Groups Projects
Commit c1d2ecb2 authored by Mathieu Leenhardt's avatar Mathieu Leenhardt
Browse files

Added fluent methods for WriteOptions, ContextPropagationToken and CallCredentials

parent 65efe426
No related branches found
No related tags found
No related merge requests found
...@@ -100,10 +100,7 @@ namespace Grpc.Core ...@@ -100,10 +100,7 @@ namespace Grpc.Core
/// </summary> /// </summary>
public WriteOptions WriteOptions public WriteOptions WriteOptions
{ {
get get { return this.writeOptions; }
{
return this.writeOptions;
}
} }
/// <summary> /// <summary>
...@@ -111,10 +108,7 @@ namespace Grpc.Core ...@@ -111,10 +108,7 @@ namespace Grpc.Core
/// </summary> /// </summary>
public ContextPropagationToken PropagationToken public ContextPropagationToken PropagationToken
{ {
get get { return this.propagationToken; }
{
return this.propagationToken;
}
} }
/// <summary> /// <summary>
...@@ -122,10 +116,7 @@ namespace Grpc.Core ...@@ -122,10 +116,7 @@ namespace Grpc.Core
/// </summary> /// </summary>
public CallCredentials Credentials public CallCredentials Credentials
{ {
get get { return this.credentials; }
{
return this.credentials;
}
} }
/// <summary> /// <summary>
...@@ -164,6 +155,42 @@ namespace Grpc.Core ...@@ -164,6 +155,42 @@ namespace Grpc.Core
return newOptions; return newOptions;
} }
/// <summary>
/// Returns new instance of <see cref="CallOptions"/> with
/// <c>WriteOptions</c> set to the value provided. Values of all other fields are preserved.
/// </summary>
/// <param name="cancellationToken">The write options.</param>
public CallOptions WithWriteOptions(WriteOptions writeOptions)
{
var newOptions = this;
newOptions.writeOptions = writeOptions;
return newOptions;
}
/// <summary>
/// Returns new instance of <see cref="CallOptions"/> with
/// <c>PropagationToken</c> set to the value provided. Values of all other fields are preserved.
/// </summary>
/// <param name="propagationToken">The context propagation token.</param>
public CallOptions WithPropagationToken(ContextPropagationToken propagationToken)
{
var newOptions = this;
newOptions.propagationToken = propagationToken;
return newOptions;
}
/// <summary>
/// Returns new instance of <see cref="CallOptions"/> with
/// <c>Credentials</c> set to the value provided. Values of all other fields are preserved.
/// </summary>
/// <param name="credentials">The call credentials.</param>
public CallOptions WithCredentials(CallCredentials credentials)
{
var newOptions = this;
newOptions.credentials = credentials;
return newOptions;
}
/// <summary> /// <summary>
/// Returns a new instance of <see cref="CallOptions"/> with /// Returns a new instance of <see cref="CallOptions"/> with
/// all previously unset values set to their defaults and deadline and cancellation /// all previously unset values set to their defaults and deadline and cancellation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment