private void RegisterInternal <TImplementation>(Action <StronglyTypedServiceConfigurator <TImplementation> >?configurator, SinglyLinkedListNode <Type> serviceTypes, string callerFilePath, int callerLineNumber)
        {
            var metadata = new BindingMetadata(callerFilePath, callerLineNumber, Registrations.CurrentModule);
            var context  = new StronglyTypedServiceConfigurator <TImplementation>(metadata, serviceTypes, Settings);

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

            Registrations.AddBinding(serviceBinding);
        }
Exemple #2
0
        private void RegisterInternal <TDependency, TInstance>(Action <StronglyTypedServiceConfigurator <TDependency, TInstance> >?configurator = null, string callerFilePath = "", int callerLineNumber = -1)
            where TInstance : class, TDependency
        {
            var context = new StronglyTypedServiceConfigurator <TDependency, TInstance>(callerFilePath, callerLineNumber, Registrations.CurrentModule);

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

            Registrations.AddBinding(binding);
        }
        private void RegisterInternal <TDependency, TInstance>(Action <StronglyTypedServiceConfigurator <TDependency, TInstance> >?configurator, IConstructorResolver?constructorSelector, string callerFilePath, int callerLineNumber)
            where TInstance : class, TDependency
        {
            var metadata = new BindingMetadata(callerFilePath, callerLineNumber, Registrations.CurrentModule);
            var context  = new StronglyTypedServiceConfigurator <TDependency, TInstance>(metadata, Settings, constructorSelector);

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

            Registrations.AddBinding(serviceBinding);
        }