Skip to content

The XML documentation for WithCommand is wrong/misleading #1682

@aradalvand

Description

@aradalvand

Problem

The ContainerBuilder.WithCommand method's <summary> documentation says the following:

Overrides the container's command arguments.

But this is outright incorrect — the method is in fact additive — as acknowledged here and here.

And I'm specifically talking about the params string[] command overload, and not the ComposableEnumerable<string> overload, which enables the customization of that behavior — notice the use of AppendEnumerable inside the params string[] command overload's body:

/// <inheritdoc />
public TBuilderEntity WithCommand(params string[] command)
{
  var composable = new AppendEnumerable<string>(command);
  return WithCommand(composable);
}

/// <inheritdoc />
public TBuilderEntity WithCommand(ComposableEnumerable<string> command)
{
  return Clone(new ContainerConfiguration(command: command));
}

It's puzzling to me why the docs for this overload weren't updated as part of #1506 since it's obviously wrong, and could be confusing to newcomers (as it was to me).

Solution

Update the XML docs for that method.

Benefit

N/A

Alternatives

N/A

Would you like to help contributing this enhancement?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions