diff --git a/Directory.Packages.props b/Directory.Packages.props
index bb1ab729..3f0f6d4f 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -38,6 +38,7 @@
+
@@ -58,4 +59,4 @@
-
\ No newline at end of file
+
diff --git a/src/cli/Commands/AuthCommander.cs b/src/cli/Commands/AuthCommander.cs
index 33901681..f895b56f 100644
--- a/src/cli/Commands/AuthCommander.cs
+++ b/src/cli/Commands/AuthCommander.cs
@@ -40,7 +40,7 @@ namespace cli.Commands
});
loginCommand.OnExecute(async () =>
{
- string? authUrl = Program.AppConfiguration.GetValue("ConnectionSettings:ServerApi:Authority");
+ string? authHostName = Program.AppConfiguration.GetRequiredSection("ConnectionSettings:ServerApi")["Authority"];
throw new NotImplementedException();
/*
diff --git a/src/cli/Commands/GenerationCommander.cs b/src/cli/Commands/GenerationCommander.cs
index e871f61b..55712f5b 100644
--- a/src/cli/Commands/GenerationCommander.cs
+++ b/src/cli/Commands/GenerationCommander.cs
@@ -11,9 +11,19 @@ namespace cli.Commands
{
public class GenerationCommander : ICommander
{
+ private MvcGenerator mvcGenerator;
+ private ILoggerFactory loggerFactory;
+ private IOptions options;
- public GenerationCommander()
+ public GenerationCommander(
+ MvcGenerator mvcGenerator,
+ ILoggerFactory loggerFactory,
+ IOptions options
+ )
{
+ this.mvcGenerator = mvcGenerator;
+ this.loggerFactory = loggerFactory;
+ this.options = options;
}
public CommandLineApplication Integrate(CommandLineApplication rootApp)
@@ -35,13 +45,7 @@ namespace cli.Commands
});
cmd.OnExecute(() => {
- var mailer = Program.AppHost.Services.GetService();
- var loggerFactory = Program.AppHost.Services.GetService();
var logger = loggerFactory.CreateLogger();
- var options = Program.AppHost.Services.GetService>();
-
- MvcGenerator generator = Program.AppHost.Services.GetService();
-
var modelFullName = mdClass?.Value ?? options?.Value.ModelFullName;
var nameSpace = nameSpaceArg?.Value?? options?.Value.NameSpace;
var dbContext = dbCtx?.Value?? options?.Value.DbContextFullName;
@@ -51,7 +55,7 @@ namespace cli.Commands
logger.LogInformation("Starting generation");
logger.LogInformation($"Using parameters : modelFullName:{modelFullName} nameSpace:{nameSpace} dbContext:{dbContext} controllerName:{controllerName} relativePath:{relativePath}");
- generator.Generate(modelFullName,
+ mvcGenerator.Generate(modelFullName,
dbContext,
controllerName,
relativePath);
diff --git a/src/cli/cli.csproj b/src/cli/cli.csproj
index 33746cc8..c136b874 100644
--- a/src/cli/cli.csproj
+++ b/src/cli/cli.csproj
@@ -10,10 +10,12 @@
+
+
-
-
+
+
-
\ No newline at end of file
+