Skip to content

A NullOrInvalidValue method #173

@C0DK

Description

@C0DK

I'd love to be able to get an ArgumentNullException when the value is null and a plain ArgumentException when it simply has some invalid form. My current best practice for this is:

Actions = Guard.Against.InvalidInput(
     Guard.Against.Null(actions, nameof(actions)),
     nameof(actions), HasNoDuplicates).ToList();

However, it is a bit cumbersome. It'd be nice to have a method that would make it possible to do:

Actions = Guard.Against.NullOrInvalidInput(actions, nameof(actions), HasNoDuplicates).ToList();

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions