[WIP] embed code generation
This commit is contained in:
parent
ec468c97f2
commit
32c7ce0867
11 changed files with 303 additions and 37 deletions
|
|
@ -172,7 +172,7 @@ namespace cli.Services
|
|||
else if (!mailSentInfo.Sent)
|
||||
logger.LogError($"{mailSentInfo.ErrorMessage}");
|
||||
else
|
||||
logger.LogInformation($"mailId:{mailSentInfo.MessageId} \nto:{user.UserName}");
|
||||
logger.LogInformation($"mailId:{mailSentInfo?.MessageId} \nto:{user.UserName}");
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
30
src/cli/Services/MvcGenerator.cs
Normal file
30
src/cli/Services/MvcGenerator.cs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
using System;
|
||||
using Microsoft.Extensions.CodeGenerators.Mvc.Controller;
|
||||
|
||||
namespace cli.Services
|
||||
{
|
||||
|
||||
public class MvcGenerator : CommandLineGenerator
|
||||
{
|
||||
CommandLineGeneratorModel _model;
|
||||
public MvcGenerator (IServiceProvider services): base (services)
|
||||
{
|
||||
_model = new CommandLineGeneratorModel();
|
||||
}
|
||||
|
||||
public async void Generate(
|
||||
string modelClass,
|
||||
string ns,
|
||||
string dbContextFullName,
|
||||
string controllerName,
|
||||
string relativeFolderPath
|
||||
)
|
||||
{
|
||||
_model.ControllerName = controllerName;
|
||||
_model.ModelClass = modelClass;
|
||||
_model.DataContextClass = dbContextFullName;
|
||||
_model.RelativeFolderPath = relativeFolderPath;
|
||||
await GenerateCode(_model);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue