Esempio n. 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);
        }
Esempio n. 2
0
        internal InjectionModel InjectType(Type type)
        {
            var injectionModel = new InjectionModel(
                type: type,
                injectionMode: SpeckType.PerRequest);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }
Esempio n. 3
0
        internal InjectionModel InjectSingleton(Type type)
        {
            var injectionModel = new InjectionModel(
                type: type,
                referencedType: type);

            InjectionModels.Add(injectionModel);
            return(injectionModel);
        }
Esempio n. 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);
        }