private IEnumerable <Lazy <T> > GetExportsCore <T>(string contractName) { IEnumerable <Export> exports = this.GetExportsCore(typeof(T), (Type)null, contractName, ImportCardinality.ZeroOrMore); Collection <Lazy <T> > result = new Collection <Lazy <T> >(); foreach (Export export in exports) { result.Add(ExportServices.CreateStronglyTypedExportOfT <T>(export)); } return(result); }
private Lazy <T> GetExportCore <T>(string contractName) { Export export = this.GetExportsCore(typeof(T), null, contractName, ImportCardinality.ExactlyOne).SingleOrDefault(); return((export != null) ? ExportServices.CreateStronglyTypedExportOfT <T>(export) : null); }