-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathSimpleInvocationBinder.cs
More file actions
35 lines (29 loc) · 1017 Bytes
/
SimpleInvocationBinder.cs
File metadata and controls
35 lines (29 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.SignalR;
internal sealed class SimpleInvocationBinder : IInvocationBinder
{
private readonly Type _returnType;
public SimpleInvocationBinder(Type returnType)
{
_returnType = returnType ?? throw new ArgumentNullException(nameof(returnType));
}
public Type GetReturnType(string invocationId)
{
return _returnType;
}
public IReadOnlyList<Type> GetParameterTypes(string methodName)
{
// No parameters for responses in this scenario
return Array.Empty<Type>();
}
#pragma warning disable IDE0060 // Remove unused parameter
public Type GetStreamItemType(string streamId)
#pragma warning restore IDE0060 // Remove unused parameter
{
// No streaming in this scenario
return typeof(object);
}
}