Class DiscoverContextsUseCase
- Namespace
- ProjGraph.Lib.EntityFramework.Application.UseCases
- Assembly
- ProjGraph.Lib.EntityFramework.dll
Use case for discovering all DbContext classes within a C# file.
public class DiscoverContextsUseCase
- Inheritance
-
DiscoverContextsUseCase
- Inherited Members
Constructors
DiscoverContextsUseCase(IEfModelAnalyzer, IFileSystem)
Use case for discovering all DbContext classes within a C# file.
public DiscoverContextsUseCase(IEfModelAnalyzer modelAnalyzer, IFileSystem fileSystem)
Parameters
modelAnalyzerIEfModelAnalyzerThe EF model analyzer used for DbContext discovery.
fileSystemIFileSystemThe file system abstraction for reading source files.
Methods
ExecuteAsync(string)
Executes the discovery of all DbContext classes within a specified C# file.
public Task<List<string>> ExecuteAsync(string path)
Parameters
pathstringThe file path to the C# source file to analyze.
Returns
- Task<List<string>>
A task that represents the asynchronous operation. The task result contains a list of discovered DbContext class names.
Exceptions
- ArgumentException
Thrown when the provided file path is not a .cs file.