コード例 #1
0
        public IContainerConfiguration RegisterInstance(Type serviceType, object instance, string serviceName = null)
        {
            var identity = new ServiceIdentity(serviceType, serviceName);
            var activatorConfiguration = new InstanceActivatorConfiguration <object>(identity, instance);

            return(Register(activatorConfiguration));
        }
コード例 #2
0
        public IInstanceActivatorConfiguration UsingInstance(object instance)
        {
            var configuration = new InstanceActivatorConfiguration <object>(Identity, instance);

            Configuration = configuration;

            return(configuration);
        }
コード例 #3
0
        public IContainerConfiguration RegisterInstance <TService>(TService instance, string serviceName = null)
            where TService : class
        {
            var serviceType            = typeof(TService);
            var identity               = new ServiceIdentity(serviceType, serviceName);
            var activatorConfiguration = new InstanceActivatorConfiguration <TService>(identity, instance);

            return(Register(activatorConfiguration));
        }