Interface IEntityFileDiscovery
- Namespace
- ProjGraph.Lib.EntityFramework.Application
- Assembly
- ProjGraph.Lib.EntityFramework.dll
Provides methods for discovering entity-related source files within a workspace.
public interface IEntityFileDiscovery
Methods
BuildLocalSearchDirectories(string)
Builds the narrow search list — the context directory and its immediate parent — for discovery that collects by shape rather than by name and would over-collect over a wider radius.
IReadOnlyList<string> BuildLocalSearchDirectories(string contextDirectory)
Parameters
contextDirectorystringThe directory containing the context file.
Returns
BuildSearchDirectories(string)
Builds a list of directories to search for entity files based on a context file directory.
IReadOnlyList<string> BuildSearchDirectories(string contextDirectory)
Parameters
contextDirectorystringThe directory containing the context file.
Returns
DiscoverBaseClassFilesAsync(Dictionary<string, string>, string)
Discovers source files containing base class definitions used by entity types.
Task<Dictionary<string, string>> DiscoverBaseClassFilesAsync(Dictionary<string, string> entityFiles, string contextDirectory)
Parameters
entityFilesDictionary<string, string>A dictionary of entity type names and their file paths.
contextDirectorystringThe directory containing the context file.
Returns
DiscoverConfigurationFilesAsync(IReadOnlyList<string>, string)
Discovers source files declaring an IEntityTypeConfiguration<T> class within the given
search directories.
Task<Dictionary<string, string>> DiscoverConfigurationFilesAsync(IReadOnlyList<string> searchDirectories, string contextFilePath)
Parameters
searchDirectoriesIReadOnlyList<string>The directories to search for configuration files.
contextFilePathstringThe file path of the context file to exclude.
Returns
DiscoverEntityFilesAsync(IReadOnlyList<string>, HashSet<string>, string)
Discovers source files containing entity type definitions referenced by a DbContext.
Task<Dictionary<string, string>> DiscoverEntityFilesAsync(IReadOnlyList<string> searchDirectories, HashSet<string> entityTypeNames, string contextFilePath)
Parameters
searchDirectoriesIReadOnlyList<string>The directories to search for entity files.
entityTypeNamesHashSet<string>The set of entity type names to search for.
contextFilePathstringThe file path of the context file to exclude.
Returns
ExtractBaseClassNamesFromSyntax(SyntaxNode, HashSet<string>)
Extracts base class names from a syntax node and adds them to the provided set.
void ExtractBaseClassNamesFromSyntax(SyntaxNode root, HashSet<string> baseClassNames)
Parameters
rootSyntaxNodeThe root syntax node to analyze.
baseClassNamesHashSet<string>The set to store extracted base class names.
ExtractEntityTypeNames(ClassDeclarationSyntax)
Extracts entity type names from a DbContext class declaration.
HashSet<string> ExtractEntityTypeNames(ClassDeclarationSyntax contextClass)
Parameters
contextClassClassDeclarationSyntaxThe class declaration syntax of the DbContext.
Returns
SearchForBaseClassFiles(HashSet<string>, DirectoryInfo)
Searches for source files containing base class definitions in a directory.
Dictionary<string, string> SearchForBaseClassFiles(HashSet<string> baseClassNames, DirectoryInfo searchDirectory)
Parameters
baseClassNamesHashSet<string>The set of base class names to search for.
searchDirectoryDirectoryInfoThe directory to search within.