Skip to main content

Definition

Assembly: CloudNimble.EasyAF.MSBuild.dll Namespace: CloudNimble.EasyAF.MSBuild Inheritance: System.Object

Syntax

CloudNimble.EasyAF.MSBuild.ItemBuilder

Summary

Builder class for configuring individual MSBuild items in a fluent manner.

Remarks

This class provides a fluent API for adding metadata to MSBuild items.

Constructors

.ctor Inherited

Inherited from object

Syntax

public Object()

Methods

AddMetadata

Adds metadata to the item.

Syntax

public CloudNimble.EasyAF.MSBuild.ItemBuilder AddMetadata(string name, string value)

Parameters

NameTypeDescription
namestringThe metadata name.
valuestringThe metadata value.

Returns

Type: CloudNimble.EasyAF.MSBuild.ItemBuilder The current instance for method chaining.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when name or value is null or whitespace.

Equals Inherited Virtual

Inherited from object

Syntax

public virtual bool Equals(object obj)

Parameters

NameTypeDescription
objobject?-

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

public static bool Equals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

public virtual int GetHashCode()

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

public System.Type GetType()

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

protected internal object MemberwiseClone()

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

public static bool ReferenceEquals(object objA, object objB)

Parameters

NameTypeDescription
objAobject?-
objBobject?-

Returns

Type: bool Sets the Link metadata for the item (commonly used with AdditionalFiles).

Syntax

public CloudNimble.EasyAF.MSBuild.ItemBuilder SetLink(string value)

Parameters

NameTypeDescription
valuestringThe Link value.

Returns

Type: CloudNimble.EasyAF.MSBuild.ItemBuilder The current instance for method chaining.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when value is null or whitespace.

SetPrivateAssets

Sets the PrivateAssets metadata for the item (commonly used with PackageReference).

Syntax

public CloudNimble.EasyAF.MSBuild.ItemBuilder SetPrivateAssets(string value)

Parameters

NameTypeDescription
valuestringThe PrivateAssets value (e.g., “all”, “runtime”, “compile”).

Returns

Type: CloudNimble.EasyAF.MSBuild.ItemBuilder The current instance for method chaining.

Exceptions

ExceptionDescription
ArgumentExceptionThrown when value is null or whitespace.

SetVisible

Sets the Visible metadata for the item.

Syntax

public CloudNimble.EasyAF.MSBuild.ItemBuilder SetVisible(bool visible)

Parameters

NameTypeDescription
visibleboolWhether the item should be visible.

Returns

Type: CloudNimble.EasyAF.MSBuild.ItemBuilder The current instance for method chaining.

ToString Inherited Virtual

Inherited from object

Syntax

public virtual string ToString()

Returns

Type: string?