|
|
@ -28,6 +28,8 @@ namespace Grpc.Core |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
public abstract class ServerCallContext |
|
|
|
public abstract class ServerCallContext |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
private Dictionary<object, object> userState; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Creates a new instance of <c>ServerCallContext</c>. |
|
|
|
/// Creates a new instance of <c>ServerCallContext</c>. |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
@ -118,7 +120,18 @@ namespace Grpc.Core |
|
|
|
/// Gets a dictionary that can be used by the various interceptors and handlers of this |
|
|
|
/// Gets a dictionary that can be used by the various interceptors and handlers of this |
|
|
|
/// call to store arbitrary state. |
|
|
|
/// call to store arbitrary state. |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
public IDictionary<object, object> UserSate => UserStateCore; |
|
|
|
public virtual IDictionary<object, object> UserSate |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
get |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (userState == null) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
userState = new Dictionary<object, object>(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return userState; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders); |
|
|
|
protected abstract Task WriteResponseHeadersAsyncCore(Metadata responseHeaders); |
|
|
@ -144,7 +157,5 @@ namespace Grpc.Core |
|
|
|
protected abstract WriteOptions WriteOptionsCore { get; set; } |
|
|
|
protected abstract WriteOptions WriteOptionsCore { get; set; } |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
protected abstract AuthContext AuthContextCore { get; } |
|
|
|
protected abstract AuthContext AuthContextCore { get; } |
|
|
|
/// <summary>Provides implementation of a non-virtual public member.</summary> |
|
|
|
|
|
|
|
protected abstract IDictionary<object, object> UserStateCore { get; } |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|