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); } }
public IDependencyInjectorEntry AsSingleton() { resultType = DependencyInjectorEntryType.SINGLETON; return(this); }
public IDependencyInjectorEntry AsLazy(Lazy <object> Lazy) { resultType = DependencyInjectorEntryType.LAZY; this.Lazy = Lazy; return(this); }
public IDependencyInjectorEntry AsFunction(Func <object> Function) { resultType = DependencyInjectorEntryType.FUNCTION; this.Function = Function; return(this); }
public IDependencyInjectorEntry AsInstance(object Instance) { resultType = DependencyInjectorEntryType.INSTANCE; this.Instance = Instance; return(this); }
public bool IsEntryType(DependencyInjectorEntryType type) { return(resultType == type); }