Пример #1
0
        internal InjectionModel InjectSingleton(object formattedObject, Type referencedType)
        {
            var type           = formattedObject.GetType();
            var injectionModel = new InjectionModel(type, formattedObject, referencedType);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }
Пример #2
0
        internal InjectionModel InjectType(Type type)
        {
            var injectionModel = new InjectionModel(
                type: type,
                injectionMode: SpeckType.PerRequest);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }
Пример #3
0
        internal InjectionModel InjectSingleton(Type type)
        {
            var injectionModel = new InjectionModel(
                type: type,
                referencedType: type);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }
Пример #4
0
        internal InjectionModel InjectSingleton(Type type, Type referencedType, object[] instances)
        {
            InjectionModel injectionModel = instances.Any()
                                          ? new InjectionModel(
                type: type,
                referencedType: referencedType,
                parameters: instances)
                                          : new InjectionModel(
                type: type,
                referencedType: referencedType);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }