示例#1
0
 private string GetNamespace(string relativeFolderPath)
 {
     return(NameSpaceUtilities.GetSafeNameSpaceFromPath(
                relativeFolderPath,
                this._applicationInfo.ApplicationName
                ));
 }
示例#2
0
 private string GetDefaultPageModelNamespaceName(string relativeFolderPath)
 {
     return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, ApplicationInfo.ApplicationName));
 }
示例#3
0
        public async Task GenerateAsync(MvcModel model)
        {
            logger.LogMessage("creating controller");
            model.ControllerName = string.Concat(model.ModelClass, Constants.ControllerSuffix);

            logger.LogMessage("creating model controller");

            var templateModel = new ClassNameModel(className: model.ControllerName, namespaceName: NameSpaceUtilities.GetSafeNameSpaceFromPath(applicationInfo.ApplicationBasePath));

            logger.LogMessage("creating files");
            var outputPath = ValidateAndGetOutputPath(model, string.Concat(model.ControllerName, Constants.CodeFileExtension));
            await codeGeneratorActionsService.AddFileFromTemplateAsync(outputPath, Constants.EmptyControllerTemplate, TemplateFolders, templateModel);
        }
示例#4
0
 protected string GetDefaultControllerNamespace(string relativeFolderPath)
 {
     return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, ApplicationInfo.ApplicationName));
 }
示例#5
0
 private string GetDefaultPageModelNamespaceName(string relativeFolderPath)
 {
     return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, _projectContext.RootNamespace));
 }
示例#6
0
 public void TestGetSafeNameSpaceNameFromPath(string path, string prefix, string expected)
 {
     Assert.Equal(expected, NameSpaceUtilities.GetSafeNameSpaceFromPath(path, prefix));
 }