[WIP] embed code generation

This commit is contained in:
Paul Schneider 2019-01-08 15:00:58 +00:00
commit 32c7ce0867
11 changed files with 303 additions and 37 deletions

View file

@ -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}");

View 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);
}
}
}