internal WeaklyTypedServiceConfigurator(Type dependencyType, Type instanceType, BindingMetadata bindingMetadata)
 {
     ServiceTypeValidator.CheckIsEnumerable(dependencyType);
     ServiceTypeValidator.CheckIsAssignable(dependencyType, instanceType);
     _instanceType    = instanceType;
     _bindingMetadata = bindingMetadata;
     _dependencyTypes = new SinglyLinkedListNode <Type>(dependencyType);
 }
Esempio n. 2
0
 internal WeaklyTypedServiceConfigurator(Type dependencyType, Type instanceType, string callerFilePath, int callerLineNumber, IModule?module = null)
 {
     ServiceTypeValidator.CheckIsEnumerable(dependencyType);
     ServiceTypeValidator.CheckIsAssignable(dependencyType, instanceType);
     _instanceType     = instanceType;
     _module           = module;
     _callerFilePath   = callerFilePath;
     _callerLineNumber = callerLineNumber;
     _dependencyTypes  = new SinglyLinkedListNode <Type>(dependencyType);
 }
 /// <summary>
 /// Sets the expression that is used to create the instance(s)
 /// </summary>
 /// <param name="expression"></param>
 /// <returns></returns>
 public WeaklyTypedServiceConfigurator Inject(Expression expression)
 {
     ServiceTypeValidator.CheckIsAssignable(_dependencyTypes, expression.GetReturnType());
     _expression = expression;
     return(this);
 }