public async Task CreateRepositories() { _logger.LogTrace("Creating Repositories..."); ICollection <EntityMap> entitiesMap = await _entityService.GetEntities(false); if (entitiesMap.Count == 0) { throw new Exception($"{Path.Combine(_csproj.ProjectPath, Folder.Entities)} not found or is empty"); } foreach (EntityMap map in entitiesMap) { string content = string.Empty; content = GenerateRepositoryInterface(map); await SaveRepositoryInterface(content, map); content = GenerateRepositoryClass(map); await SaveRepositoryClass(content, map); } _csproj.FolderInclude(Folder.Repositories); _csproj.FolderInclude(Folder.Interfaces); }
public async Task CreateMappingFiles() { _logger.LogTrace("Creating Mappings..."); ICollection <EntityMap> entitiesMap = await _entityService.GetEntities(true); if (entitiesMap.Count == 0) { throw new Exception($"{Path.Combine(_csproj.ProjectPath, Folder.Entities)} not found or is empty"); } foreach (EntityMap map in entitiesMap) { string content = GenerateMappingFile(map); await SaveFile(content, map); } _csproj.FolderInclude(Folder.Mappings); }
public async Task CreateAbstractEntity() { _logger.LogTrace("Preparing Entities Folder..."); string filename = "Entity.cs"; string pathname = Path.Combine(_csproj.ProjectPath, Folder.Entities, filename); if (File.Exists(pathname) && !_options.ReplaceFile) { _logger.LogTrace($"{filename} not created. A file with that name already exists"); return; } string content = GenerateAbstractEntityFile(); await _fileService.SaveFile(content, pathname); _logger.LogTrace($"Entity.cs created"); _csproj.FolderInclude(Folder.Entities); }