private string GetNamespace(string relativeFolderPath) { return(NameSpaceUtilities.GetSafeNameSpaceFromPath( relativeFolderPath, this._applicationInfo.ApplicationName )); }
private string GetDefaultPageModelNamespaceName(string relativeFolderPath) { return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, ApplicationInfo.ApplicationName)); }
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); }
protected string GetDefaultControllerNamespace(string relativeFolderPath) { return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, ApplicationInfo.ApplicationName)); }
private string GetDefaultPageModelNamespaceName(string relativeFolderPath) { return(NameSpaceUtilities.GetSafeNameSpaceFromPath(relativeFolderPath, _projectContext.RootNamespace)); }
public void TestGetSafeNameSpaceNameFromPath(string path, string prefix, string expected) { Assert.Equal(expected, NameSpaceUtilities.GetSafeNameSpaceFromPath(path, prefix)); }