Browse Source
Merge pull request #14382 from abpframework/salihozkara/cli-null-check
Cli : Add DatabaseManagementSystemChangeStep null check
pull/14389/head
Yunus Emre Kalkan
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
1 deletions
-
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Building/Steps/DatabaseManagementSystemChangeStep.cs
|
|
|
@ -98,7 +98,13 @@ public class DatabaseManagementSystemChangeStep : ProjectBuildPipelineStep |
|
|
|
|
|
|
|
var oldUseMethod = "UseSqlServer"; |
|
|
|
|
|
|
|
var efCoreModuleClass = context.Files.First(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); |
|
|
|
var efCoreModuleClass = context.Files.FirstOrDefault(f => f.Name.EndsWith("EntityFrameworkCoreModule.cs", StringComparison.OrdinalIgnoreCase)); |
|
|
|
|
|
|
|
if(efCoreModuleClass == null) |
|
|
|
{ |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
efCoreModuleClass.ReplaceText(oldUseMethod, newUseMethodForEfModule); |
|
|
|
|
|
|
|
var dbContextFactoryFile = context.Files.FirstOrDefault(f => f.Name.EndsWith($"{(_hasDbMigrations ? "Migrations" : string.Empty)}DbContextFactoryBase.cs", StringComparison.OrdinalIgnoreCase)) |
|
|
|
|