private void CreateMicroserviceDirectory() { microserviceName = methodName + "Microservice"; microserviceSourceNamespace = microserviceName + ".Source"; var basePath = microserviceDirectoryPath + "\\" + microserviceName; sourcePath = basePath + "\\Source"; if (!Directory.Exists(sourcePath)) { ExecuteCommand(@"cd " + microserviceDirectoryPath + " && dotnet new webapi -n " + methodName + "Microservice && exit"); } Directory.CreateDirectory(sourcePath); if (Directory.Exists(sourcePath)) { foreach (var document in documentsToCopy) { var path = document.Document.FilePath; var fileName = document.Document.FilePath.Split('\\').LastOrDefault(); var newPath = sourcePath + "\\" + fileName; if (File.Exists(path) && !File.Exists(newPath)) { File.Copy(path, newPath); } } } CopyStartup(basePath, microserviceSourceNamespace); GetMicroserviceUrl(basePath, microserviceSourceNamespace); // TODO: Copy this inside the AddController method. controllerName = invokedMethodDocument.Document.Name.First() == 'I' ? invokedMethodDocument.Document.Name.Split('I').ElementAt(1).Replace("Service", "").Split('.').FirstOrDefault() : invokedMethodDocument.Document.Name.Replace("Service", "").Split('.').FirstOrDefault(); AddController( microserviceSourceNamespace, methodName + "Microservice", controllerName + "Controller", invokedMethodDocument.Document.Name.Split('.').FirstOrDefault(), invokedMethodDocument.Document.Name.Split('.').FirstOrDefault().ToLowerInvariant(), invokedMethodDocument.Document.Name, invokedMethodName, invokedMethodParameters.ToString(), invokedMethodName, basePath ); ReplaceNamespace(); }
public override void VisitParameterList(ParameterListSyntax node) { if (_targetPatternRegEx.Match(node.ToString()).Success) { RecordMatchAndContext(node, BlockType.None); } base.VisitParameterList(node); }