Table of Contents

Struct OptionalParam<T>

Namespace
DotNetDo
Assembly
DotNetDo.Core.dll

An optional typed task parameter whose absence is represented by null.

public readonly record struct OptionalParam<T> : IEquatable<OptionalParam<T>> where T : notnull

Type Parameters

T

Properties

Description

Human-readable help text supplied by the task author.

public string? Description { get; }

Property Value

string?

Name

The parameter name.

public string Name { get; }

Property Value

string

Value

The resolved parameter value, or null when absent.

public T? Value { get; }

Property Value

T?

Methods

QuotedArgument()

Renders the resolved optional value as one quoted command-line argument.

public string? QuotedArgument()

Returns

string?

Required()

Resolves the optional parameter, prompting during an interactive local build or throwing when no value is available.

public Param<T> Required()

Returns

Param<T>

Operators

implicit operator T?(OptionalParam<T>)

The resolved parameter value.

public static implicit operator T?(OptionalParam<T> parameter)

Parameters

parameter OptionalParam<T>

The optional parameter wrapper.

Returns

T?