-
Notifications
You must be signed in to change notification settings - Fork 445
Conversation
This should also work when I call AddSignalR |
public IHubProtocol GetProtocol(string protocolName, HubConnectionContext connection) | ||
{ | ||
switch (protocolName?.ToLowerInvariant()) | ||
{ | ||
case "json": | ||
return new JsonHubProtocol(new JsonSerializer()); | ||
return new JsonHubProtocol(JsonSerializer.Create(_options.Value.JsonSerializerSettings)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what settings are used if JsonSerializerSettings is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default ones. Exact same as what we were doing before.
I don't think we can JSON settings defined by the user to serialize/read our payload |
It doesn't change any of our items. Example:
Sends:
We use |
Where's the test? |
@@ -9,6 +10,12 @@ public static class SignalRDependencyInjectionExtensions | |||
{ | |||
public static ISignalRBuilder AddSignalR(this IServiceCollection services) | |||
{ | |||
return AddSignalR(services, o => { }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ => { }
🆙 📅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
However I wonder if it should be possible to set the options per Hub...
@moozzyk I think so, but we can revisit that after alpha. |
@@ -36,16 +37,19 @@ public class HubEndPoint<THub> : IInvocationBinder where THub : Hub | |||
private readonly ILogger<HubEndPoint<THub>> _logger; | |||
private readonly IServiceScopeFactory _serviceScopeFactory; | |||
private readonly IHubProtocolResolver _protocolResolver; | |||
private readonly IOptions<HubOptions> _hubOptions; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have any concrete things to add here for alpha?
Original issue that has a couple items, none look too important #254 |
#254 and #261
Wanted to get feedback to see if this is the design we want. Then I'll add a test.
Do we want it to be
HubOptions<THub>
?Current usage: