public List <T> ResolveAll <T>(DependencyInjectorEntryType type = DependencyInjectorEntryType.NONE)
        {
            lock (_lockObject)
            {
                List <T> Entries = new List <T>();

                foreach (var s in _services.Where(s => s.IsRegisteredAs(typeof(T)) && (type == DependencyInjectorEntryType.NONE || s.IsEntryType(type))))
                {
                    var service = s.GetEntry <T>();
                    if (!service.Equals(default(T)))
                    {
                        Entries.Add(service);
                    }
                }

                return(Entries);
            }
        }
Exemple #2
0
 public IDependencyInjectorEntry AsSingleton()
 {
     resultType = DependencyInjectorEntryType.SINGLETON;
     return(this);
 }
Exemple #3
0
 public IDependencyInjectorEntry AsLazy(Lazy <object> Lazy)
 {
     resultType = DependencyInjectorEntryType.LAZY;
     this.Lazy  = Lazy;
     return(this);
 }
Exemple #4
0
 public IDependencyInjectorEntry AsFunction(Func <object> Function)
 {
     resultType    = DependencyInjectorEntryType.FUNCTION;
     this.Function = Function;
     return(this);
 }
Exemple #5
0
 public IDependencyInjectorEntry AsInstance(object Instance)
 {
     resultType    = DependencyInjectorEntryType.INSTANCE;
     this.Instance = Instance;
     return(this);
 }
Exemple #6
0
 public bool IsEntryType(DependencyInjectorEntryType type)
 {
     return(resultType == type);
 }