コード例 #1
0
ファイル: DefaultAssemblyProvider.cs プロジェクト: zyonet/Mvc
        /// <summary>
        /// Returns a list of libraries that references the assemblies in <see cref="ReferenceAssemblies"/>.
        /// By default it returns all assemblies that reference any of the primary MVC assemblies
        /// while ignoring MVC assemblies.
        /// </summary>
        /// <returns>A set of <see cref="Library"/>.</returns>
        protected virtual IEnumerable <Library> GetCandidateLibraries()
        {
            if (ReferenceAssemblies == null)
            {
                return(Enumerable.Empty <Library>());
            }

            // GetReferencingLibraries returns the transitive closure of referencing assemblies
            // for a given assembly.
            return(ReferenceAssemblies.SelectMany(_libraryManager.GetReferencingLibraries)
                   .Distinct()
                   .Where(IsCandidateLibrary));
        }
コード例 #2
0
 protected IEnumerable <Library> GetCandidateLibraries()
 {
     return(ReferenceAssemblies == null
         ? Enumerable.Empty <Library>()
         : ReferenceAssemblies.SelectMany(_libraryManager.GetReferencingLibraries).Distinct().Where(IsCandidateLibrary));
 }