public void AddEntityCore(IDomainAdditionOptions options, string domainFolder, string templateFilePath, string templateFileName) { string fileData = GetFileData(options, templateFilePath); string filePath = GetFilePath(options, domainFolder, templateFileName); TypescriptClassWriter.Write(filePath, fileData); }
public void Add(IDomainAdditionOptions options) { string filePath = this.pathService.GetAbsolutePathForFrontendAppRouting(options); string fileData = UpdateFileData(options, filePath); TypescriptClassWriter.Write(filePath, fileData); }
public void Add(IDomainAdditionOptions options) { string filePath = GetFilePath(options); string fileData = UpdateFileData(options, filePath); File.WriteAllText(filePath, fileData); }
private string GetFilePath(IDomainAdditionOptions options) { string fileName = options.DbProjectName + ".sqlproj"; string filePath = Path.Combine(options.DbDestinationFolder, fileName); return(filePath); }
public string GetAbsolutePathForDbDomain(IDomainAdditionOptions options, string domainFolder) { string relativePath = domainFolder.Replace("{Domain}", options.Domain); string absolutePathForDomain = Path.Combine(options.DbDestinationFolder, relativePath); return(absolutePathForDomain); }
public void UpdateDependencyProvider(IDomainAdditionOptions options, string projectFolder, string fileName) { string filePath = GetFilePath(options, projectFolder, fileName); string fileData = UpdateFileData(options, filePath, projectFolder); CsharpClassWriter.Write(filePath, fileData); }
private string GetFilePath(IDomainAdditionOptions options, string domainFolder, string templateFileName) { string absolutePathForDomain = this.pathService.GetAbsolutePathForFrontendModel(options, domainFolder); string fileName = templateFileName.Replace("domain-kebab", StringConverter.PascalToKebabCase(options.Domain)); string filePath = Path.Combine(absolutePathForDomain, fileName); return(filePath); }
private string GetAppRoutingLine(IDomainAdditionOptions options) { return (" {\n" + $" path: '{options.Domain.ToKebab()}',\n" + $" loadChildren: () => import('./pages/{options.Domain.ToKebab()}/{options.Domain.ToKebab()}-pages.module').then(m => m.{options.Domain}PagesModule)\n" + " },"); }
public string GetAbsolutePathForFrontendModel(IDomainAdditionOptions options, string domainFolder) { string relativePath = domainFolder; relativePath = relativePath.Replace("{domain-kebab}", StringConverter.PascalToKebabCase(options.Domain)); string absolutePathForDomain = Path.Combine(options.FrontendDestinationFolder, relativePath); return(absolutePathForDomain); }
private string UpdateFileData(IDomainAdditionOptions options, string filePath, string projectFolder) { string fileData = File.ReadAllText(filePath); fileData = AddStartupMethod(fileData, options, projectFolder); fileData = AddGetStartupMethodCall(fileData, options); return(fileData); }
public void AddDbDomainFolder(IDomainAdditionOptions options, string domainFolder) { string absolutePathForDbDomain = GetAbsolutePathForDbDomain(options, domainFolder); if (!Directory.Exists(absolutePathForDbDomain)) { Directory.CreateDirectory(absolutePathForDbDomain); } }
private string GetFileData(IDomainAdditionOptions options, string templateFilePath) { string fileData = File.ReadAllText(templateFilePath); fileData = fileData.Replace("ProjectName", options.ProjectName); fileData = fileData.Replace("domain-kebab", StringConverter.PascalToKebabCase(options.Domain)); fileData = fileData.Replace("Domain", options.Domain); return(fileData); }
public void PerformAddDomainCommand(IDomainAdditionOptions options) { try { this.AddDomain(options); } catch (Exception e) { Console.WriteLine("Fehler bei Domain-Generierung: " + e.Message); } }
public static bool Validate(IDomainAdditionOptions options) { if (string.IsNullOrEmpty(options.Domain) || !options.Domain.IsAlpha()) { return(false); } options.Domain = options.Domain.UpperFirstChar(); return(true); }
public void AddDomain(IDomainAdditionOptions options) { if (!DomainAdditionOptions.Validate(options)) { throw new OptionValidationException("Die Optionen sind nicht korrekt formatiert."); } foreach (ClassGeneration classGeneration in classGenerations) { classGeneration.PerformAddDomainCommand(options); } }
private static void AddDomain(IDomainAdditionOptions domainOptions) { try { ContractorCoreApi contractorCoreApi = new ContractorCoreApi(); contractorCoreApi.AddDomain(domainOptions); Console.WriteLine($"Domain '{domainOptions.Domain}' hinzugefügt."); } catch (Exception e) { Console.WriteLine(e); } }
private string UpdateFileData(IDomainAdditionOptions options, string filePath) { string fileData = File.ReadAllText(filePath); StringEditor stringEditor = new StringEditor(fileData); // ----------- DbSet ----------- stringEditor.NextThatContains("path: '**',"); stringEditor.Prev(); stringEditor.InsertLine(GetAppRoutingLine(options)); return(stringEditor.GetText()); }
private string AddGetStartupMethodCall(string fileData, IDomainAdditionOptions options) { StringEditor stringEditor = new StringEditor(fileData); // Insert using string startupMethodCall = GetStartupMethodCall(options.Domain); stringEditor.NextThatContains("void Startup(IServiceCollection services"); stringEditor.Next(); stringEditor.Next(line => line.CompareTo(startupMethodCall) > 0 || line.Contains("}")); stringEditor.InsertLine(startupMethodCall); return(stringEditor.GetText()); }
private string AddStartupMethod(string fileData, IDomainAdditionOptions options, string projectFolder) { StringEditor stringEditor = new StringEditor(fileData); // Insert using stringEditor.MoveToEnd(); if (!stringEditor.GetLine().Contains("}")) { stringEditor.PrevThatContains("}"); } stringEditor.PrevThatContains("}"); stringEditor.InsertLine(GetStartupMethod(options.Domain, projectFolder)); return(stringEditor.GetText()); }
private string UpdateFileData(IDomainAdditionOptions options, string filePath) { string fileData = File.ReadAllText(filePath); string dbDomainFolderLine = GetDbDomainFolderLine(options); StringEditor stringEditor = new StringEditor(fileData); stringEditor.NextThatContains("Folder Include"); stringEditor.Prev(); stringEditor.Next(line => line.CompareTo(dbDomainFolderLine) > 0 || line.Contains("</ItemGroup>")); stringEditor.InsertLine(dbDomainFolderLine); return(stringEditor.GetText()); }
protected override void AddDomain(IDomainAdditionOptions options) { }
protected override void AddDomain(IDomainAdditionOptions options) { this.domainDependencyProvider.UpdateDependencyProvider(options, LogicProjectGeneration.ProjectFolder, FileName); }
private string GetFilePath(IDomainAdditionOptions options, string projectFolder, string fileName) { return(Path.Combine(options.BackendDestinationFolder, projectFolder, fileName)); }
protected override void AddDomain(IDomainAdditionOptions options) { this.pathService.AddDbDomainFolder(options, DBProjectGeneration.DomainFolder); this.dbProjectFileDomainAddition.Add(options); }
public PropertyAdditionOptions(IDomainAdditionOptions options) : base(options) { }
protected override void AddDomain(IDomainAdditionOptions options) { this.frontendPagesDomainCoreAddition.AddEntityCore(options, PagesProjectGeneration.PagesFolder, TemplatePath, FileName); }
protected abstract void AddDomain(IDomainAdditionOptions options);
private string GetDbDomainFolderLine(IDomainAdditionOptions options) { return($" <Folder Include=\"dbo\\Tables\\{options.Domain}\" />"); }
protected override void AddDomain(IDomainAdditionOptions options) { this.appRoutingDomainAddition.Add(options); }
public EntityAdditionOptions(IDomainAdditionOptions options) : base(options) { }