Class EfAnalysisService
- Namespace
- ProjGraph.Lib.EntityFramework.Application
- Assembly
- ProjGraph.Lib.EntityFramework.dll
Service responsible for analyzing Entity Framework Core models architectures. Delegates orchestration to specific use cases.
public class EfAnalysisService : IEfAnalysisService
- Inheritance
-
EfAnalysisService
- Implements
- Inherited Members
Constructors
EfAnalysisService(AnalyzeContextUseCase, DiscoverContextsUseCase, AnalyzeSnapshotUseCase, DiscoverSnapshotsUseCase)
Service responsible for analyzing Entity Framework Core models architectures. Delegates orchestration to specific use cases.
public EfAnalysisService(AnalyzeContextUseCase analyzeContextUseCase, DiscoverContextsUseCase discoverContextsUseCase, AnalyzeSnapshotUseCase analyzeSnapshotUseCase, DiscoverSnapshotsUseCase discoverSnapshotsUseCase)
Parameters
analyzeContextUseCaseAnalyzeContextUseCaseThe use case for analyzing DbContext classes.
discoverContextsUseCaseDiscoverContextsUseCaseThe use case for discovering DbContext classes.
analyzeSnapshotUseCaseAnalyzeSnapshotUseCaseThe use case for analyzing ModelSnapshot classes.
discoverSnapshotsUseCaseDiscoverSnapshotsUseCaseThe use case for discovering ModelSnapshot classes.
Methods
AnalyzeContextAsync(string, string?)
Analyzes the specified Entity Framework context and retrieves its model.
public Task<EfModel> AnalyzeContextAsync(string path, string? contextName = null)
Parameters
pathstringThe file path to the project or solution containing the context.
contextNamestringThe name of the context to analyze. If null, the default context is analyzed.
Returns
- Task<EfModel>
A task that represents the asynchronous operation. The task result contains the analyzed Entity Framework model.
AnalyzeSnapshotAsync(string, string?)
Analyzes the specified Entity Framework model snapshot and retrieves its model.
public Task<EfModel> AnalyzeSnapshotAsync(string path, string? snapshotName = null)
Parameters
pathstringThe file path to the C# file containing the model snapshot.
snapshotNamestringThe name of the snapshot to analyze. If null, the first snapshot found in the file is analyzed.
Returns
- Task<EfModel>
A task that represents the asynchronous operation. The task result contains the analyzed Entity Framework model.
DiscoverContextsAsync(string)
Discovers all Entity Framework contexts in the specified path.
public Task<List<string>> DiscoverContextsAsync(string path)
Parameters
pathstringThe file path to search for Entity Framework contexts.
Returns
- Task<List<string>>
A task that represents the asynchronous operation. The task result contains a list of discovered context names.
DiscoverSnapshotsAsync(string)
Discovers all Entity Framework model snapshots in the specified path.
public Task<List<string>> DiscoverSnapshotsAsync(string path)
Parameters
pathstringThe file path to search for Entity Framework model snapshots.