public async Task<string> RunAsync() { var generator = new WebApiAssemblyToSwaggerGenerator(Settings); var controllerNames = ControllerNames.ToList(); if (!string.IsNullOrEmpty(ControllerName)) controllerNames.Add(ControllerName); controllerNames = controllerNames.Distinct().ToList(); if (!controllerNames.Any()) controllerNames = generator.GetControllerClasses().ToList(); var service = generator.GenerateForControllers(controllerNames); return service.ToJson(); }
private Task LoadAssemblyAsync(bool updateSelectedController) { return RunTaskAsync(async () => { AllControllerNames = await Task.Run(() => { var generator = new WebApiAssemblyToSwaggerGenerator(Command.Settings); return generator.GetControllerClasses(); }); if (ControllerNames != null) { var newControllerNames = ControllerNames.ToList(); foreach (var controller in newControllerNames.ToArray()) { if (!AllControllerNames.Contains(controller)) newControllerNames.Remove(controller); } ControllerNames = newControllerNames.ToArray(); } else ControllerNames = new string[] { }; }); }
private Task LoadAssemblyAsync(bool updateSelectedController) { return RunTaskAsync(async () => { AllControllerNames = await Task.Run(() => { var generator = new WebApiAssemblyToSwaggerGenerator(Command.Settings); return generator.GetControllerClasses(); }); if (updateSelectedController) { if (ControllerName != null && !AllControllerNames.Contains(ControllerName)) ControllerName = AllControllerNames.FirstOrDefault(); } }); }
private Task LoadAssembly() { return RunTaskAsync(async () => { AllControllerNames = await Task.Run(() => { var generator = new WebApiAssemblyToSwaggerGenerator(AssemblyPath); return generator.GetControllerClasses(); }); ControllerName = AllControllerNames.FirstOrDefault(); }); }