title: In Signalr .net core - where should validation take place?
body: <p>If I have a hub method that accepts parameters</p>
  
  <p>e.g. </p>
  
  <pre><code>public IObservable&lt;MyStreamItem&gt; StreamData(SomeRequestData request)
  {}
  </code></pre>
  
  <p>How do I propogate validation errors in the request?</p>
  
  <p>An actual http request is only made when the socket connection is established.
  So subsequent calls to Hub methods dont pass through any middleware. They are just frames/messages in the open websocket.</p>
  
  <p>I've had a look at this package which is for the previous version of Signalr (for the full .net framework)
  <a href="https://github.com/AGiorgetti/SignalR.Validation" rel="nofollow noreferrer">https://github.com/AGiorgetti/SignalR.Validation</a> </p>
  
  <p>This uses a <code>HubPipelineModule</code> which doesn't seem to exist in the new .net core Signalr.</p>
  
  <p>Is there an appropriate place in the pipeline that I can tap into to do the validation?
  Or should it be done in the hub method itself? And if so, how would you conditionally return a structured set of errors, as opposed to what the actual return type is meant to be?</p>
  
  <p>thanks</p>