public override bool Execute(LamarServicesInput input) { using (var host = input.BuildHost()) { var container = TypeExtensions.As <IContainer>(host.Services); var query = input.ToModelQuery(container); var display = input.BuildPlansFlag ? WhatDoIHaveDisplay.BuildPlan : WhatDoIHaveDisplay.Summary; var writer = new WhatDoIHaveWriter(container.Model); var text = writer.GetText(query, display: display); if (input.FileFlag.IsNotEmpty()) { var fullPath = input.FileFlag.ToFullPath(); Console.WriteLine("Writing the query results to " + fullPath); File.WriteAllText(fullPath, text); } else { Console.WriteLine(text); } } return(true); }
/// <summary> /// Returns a report detailing the complete configuration of all PluginTypes and Instances /// </summary> /// <param name="pluginType">Optional parameter to filter the results down to just this plugin type</param> /// <param name="assembly">Optional parameter to filter the results down to only plugin types from this Assembly</param> /// <param name="@namespace">Optional parameter to filter the results down to only plugin types from this namespace</param> /// <param name="typeName">Optional parameter to filter the results down to any plugin type whose name contains this text</param> public string WhatDoIHave(Type pluginType = null, Assembly assembly = null, string @namespace = null, string typeName = null) { var writer = new WhatDoIHaveWriter(_pipelineGraph); return(writer.GetText(new ModelQuery { Assembly = assembly, Namespace = @namespace, PluginType = pluginType, TypeName = typeName })); }
public string HowDoIBuild(Type serviceType = null, Assembly assembly = null, string @namespace = null, string typeName = null) { assertNotDisposed(); var writer = new WhatDoIHaveWriter(Model); return(writer.GetText(new ModelQuery { Assembly = assembly, Namespace = @namespace, ServiceType = serviceType, TypeName = typeName }, display: WhatDoIHaveDisplay.BuildPlan)); }
public string WhatDoIHave(Type serviceType = null, Assembly assembly = null, string @namespace = null, string typeName = null) { assertNotDisposed(); var writer = new WhatDoIHaveWriter(ServiceGraph); return(writer.GetText(new ModelQuery { Assembly = assembly, Namespace = @namespace, ServiceType = serviceType, TypeName = typeName })); }
/// <summary> /// Returns a report detailing the complete configuration of all PluginTypes and Instances /// </summary> /// <returns></returns> public string WhatDoIHave() { var writer = new WhatDoIHaveWriter(_pipelineGraph); return(writer.GetText()); }