Ejemplo n.º 1
0
            public static string WriteClassInterface(HttpController controller)
            {
                return
                    ($@"
{SharedWriter.GetObsolete(controller)}
public interface I{controller.ClientName} : I{Settings.ClientInterfaceName}
{{
{string.Join($"{Environment.NewLine}", controller.GetEndpoints().Select(WriteEndpointInterface))}
}}
");
            }
Ejemplo n.º 2
0
            public static string WriteClassImplementation(HttpController controller)
            {
                var dependencies = controller.GetInjectionDependencies().ToList();

                dependencies.Insert(0, new ClientDependency($"I{Settings.ClientInterfaceName}Wrapper"));

                return
                    ($@"
{SharedWriter.GetObsolete(controller)}
{(Settings.UseInternalClients ? "internal" : "public")} class {controller.ClientName} : I{controller.ClientName}
{{
{string.Join($"{Environment.NewLine}", dependencies.Select(WriteDependenciesField))}

	public {controller.ClientName}(
{string.Join($",{Environment.NewLine}", dependencies.Select(WriteDependenciesParameter))})
	{{
{string.Join($"{Environment.NewLine}", dependencies.Select(WriteDependenciesAssignment))}
	}}

{string.Join($"{Environment.NewLine}", controller.GetEndpoints().Select(x => WriteEndpointImplementation(controller, x)))}
}}
");
            }