SignalR module Hubs and IRepository

Topics: Writing modules
Mar 31, 2013 at 9:59 PM
I'm using the Proligence.SignalR module for Orchard. In a hub I'm injecting services for data storage that wrap an IRepository<T>.

I'm noticing that the IRepositories don't like it. Problem is related to transactions, which is not suprising since I believe the repository transaction is based on a per http request and signalR.. well not sure (still learning)

So before opening a can of worms with details, I'll ask ... Is the SingalR module designed to wire up Orchard services such as IRepository and ConnectionManager etc? I may be misusing the module or perhaps doing something that it is not intended to do.
Apr 1, 2013 at 9:11 AM
I use a different SignalR module, however I would imagine the concepts are the same. I have tended to wrap up my dependencies with Work<>
public class WaveHub : Hub {
    private readonly Work<IContentManager> _workContentManager;
    private readonly Work<IAuthenticationService> _workAuthenticationService;

    private const string ContentGroupNameFormat = "ContentItem-{0}";

    public WaveHub(Work<IContentManager> workContentManager,
                   Work<IAuthenticationService> workAuthenticationService) {
        _workContentManager = workContentManager;
        _workAuthenticationService = workAuthenticationService;

    private IContentManager ContentManager {
        get { return _workContentManager.Value; }

    private IAuthenticationService AuthenticationService {
        get { return _workAuthenticationService.Value; }
Apr 3, 2013 at 11:19 PM
Finally got to trying Work<>. Thats a new one for me. It seems to have fixed the issues so all good. Thank you, don't think I would have found that on my own.