Пример #1
0
        private void RegisterInternal(Type dependencyType, Type instanceType, Action <WeaklyTypedServiceConfigurator>?configurator = null, string callerFilePath = "", int callerLineNumber = -1)
        {
            var context = new WeaklyTypedServiceConfigurator(dependencyType, instanceType, callerFilePath, callerLineNumber, Registrations.CurrentModule);

            configurator?.Invoke(context);
            Binding binding = context.ToBinding();

            Registrations.AddBinding(binding);
        }
        private void RegisterInternal(Type dependencyType, Type instanceType, Action <WeaklyTypedServiceConfigurator>?configurator, IConstructorResolver?constructorSelector, string callerFilePath, int callerLineNumber)
        {
            var metadata = new BindingMetadata(callerFilePath, callerLineNumber, Registrations.CurrentModule);
            var context  = new WeaklyTypedServiceConfigurator(dependencyType, instanceType, metadata, Settings, constructorSelector);

            configurator?.Invoke(context);
            ServiceBinding serviceBinding = context.ToBinding();

            Registrations.AddBinding(serviceBinding);
        }
Пример #3
0
        private void RegisterInternal(SinglyLinkedListNode <Type> serviceTypes, Type implementationType, Action <WeaklyTypedServiceConfigurator>?configurator, string callerFilePath, int callerLineNumber)
        {
            var metadata = new BindingMetadata(callerFilePath, callerLineNumber, Registrations.CurrentModule);
            var context  = new WeaklyTypedServiceConfigurator(serviceTypes, implementationType, metadata, Settings);

            configurator?.Invoke(context);
            ServiceBinding serviceBinding = context.ToBinding();

            Registrations.AddBinding(serviceBinding);
        }