Esempio n. 1
0
        public IIoCRegistrationConfigurator <T> Register <T>(Func <T> factory)
        {
            var registration = new IoCRegistration <T>(factory)
            {
                CanBeScoped = true
            };

            _registrator.Register(registration);
            return(new IoCRegistrationConfigurator <T>(_registrator, registration));
        }
Esempio n. 2
0
        public IIoCRegistrationSingletonConfigurator <T> Register <T>(T singleton)
        {
            var registration = new IoCRegistration <T>(() => singleton)
            {
                CanBeScoped = false
            };

            _registrator.Register(registration);
            return(new IoCRegistrationConfigurator <T>(_registrator, registration));
        }
Esempio n. 3
0
        public IIoCRegistrationConfigurator <TImplementation> Register <T, TImplementation>()
        {
            var registration = new IoCRegistration <TImplementation>()
            {
                CanBeScoped = true
            };

            _registrator.Register(typeof(T), registration);
            _registrator.Register(registration);
            return(new IoCRegistrationConfigurator <TImplementation>(_registrator, registration));
        }
 public IoCRegistrationConfigurator(IIoCRegistrator registrator, IoCRegistration <T> registration)
 {
     _registrator  = registrator;
     _registration = registration;
 }