Example #1
0
    public SingleThreadServiceRegistration <TService> RegisterSingleThread <TService>(Func <TService> FactoryMethod) where TService : class
    {
        var service_interface = typeof(TService);

        lock (_SyncRoot)
        {
            var registration = new SingleThreadServiceRegistration <TService>(this, service_interface, FactoryMethod);
            _Services[service_interface] = registration;
            return(registration);
        }
    }
Example #2
0
    public SingleThreadServiceRegistration <TService> RegisterSingleThread <TService>() where TService : class
    {
        var service_type = typeof(TService);

        lock (_SyncRoot)
        {
            var registration = new SingleThreadServiceRegistration <TService>(this, typeof(TService));
            _Services[service_type] = registration;
            return(registration);
        }
    }