Skip to content

Review use of ArgumentException/ArgumentNullException in all public APIs #2649

Closed

Description

I noticed we seem to have lots of public APIs that accept reference type parameters not marked as nullable but then don't check that they're actually non-null and throw an ArgumentNullException when necessary. We should decide what we're doing and review all public APIs for appropriate argument validation.

e.g.

public static IResourceBuilder<T> WithEnvironment<T>(this IResourceBuilder<T> builder, string name, IResourceBuilder<ParameterResource> parameter) where T : IResourceWithEnvironment
{
return builder.WithEnvironment(context =>
{
context.EnvironmentVariables[name] = parameter.Resource;
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationgood first issueGood for newcomershelp wantedIssue that is a good candidate for community contribution.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions