protected override void Generate(
            CodeWriter writer,
            DependencyInjectionDescriptor descriptor,
            out string fileName)
        {
            fileName = ServiceCollectionExtensionsFromClientName(descriptor.Name);

            ClassBuilder factory = ClassBuilder
                                   .New(fileName)
                                   .SetStatic()
                                   .SetAccessModifier(AccessModifier.Public);

            factory
            .AddMethod($"Add{descriptor.Name}")
            .SetPublic()
            .SetStatic()
            .SetReturnType(TypeNames.IServiceCollection)
            .AddParameter(
                "services",
                x => x.SetThis().SetType(TypeNames.IServiceCollection))
            .AddParameter(
                "strategy",
                x => x.SetType(TypeNames.ExecutionStrategy)
                .SetDefault(
                    TypeNames.ExecutionStrategy + "." +
                    nameof(ExecutionStrategy.NetworkOnly)))
            .AddCode(GenerateMethodBody(descriptor));

            factory
            .AddMethod("ConfigureClient")
            .SetPrivate()
            .SetStatic()
            .SetReturnType(TypeNames.IServiceCollection)
            .AddParameter("services", x => x.SetType(TypeNames.IServiceCollection))
            .AddParameter("parentServices", x => x.SetType(TypeNames.IServiceProvider))
            .AddParameter(
                "strategy",
                x => x.SetType(TypeNames.ExecutionStrategy)
                .SetDefault(
                    TypeNames.ExecutionStrategy + "." +
                    nameof(ExecutionStrategy.NetworkOnly)))
            .AddCode(GenerateInternalMethodBody(descriptor));

            factory.AddClass(_clientServiceProvider);

            CodeFileBuilder
            .New()
            .SetNamespace(descriptor.Namespace)
            .AddType(factory)
            .Build(writer);
        }