示例#1
0
        public IRegistration <IAsTrait> RegisterInstance <T>(object instance)
        {
            var instanceType = typeof(T);
            var registration = new SingleInstanceRegistration(instance, instanceType);

            _registrations.Add(registration);
            return(registration);
        }
示例#2
0
        public IRegistration <IAsTrait> RegisterInstance <T>(T instance) where T : class
        {
            var instanceType = typeof(T);

            if (instance != null)
            {
                instanceType = instance.GetType();
            }
            var registration = new SingleInstanceRegistration(instance, instanceType);

            _registrations.Add(registration);
            return(registration);
        }