Skip to main content

Definition

Assembly: CloudNimble.EasyAF.Tools.dll Namespace: CloudNimble.EasyAF.Tools.Scaffolding Inheritance: System.Object

Syntax

Summary

Renders text files embedded in an assembly, replacing {{Token}} placeholders, and writes them to disk.

Remarks

Resources are expected to use path-preserving logical names (for example Resources/Api/Program.cs) so that folder names containing dots are not confused with nested folders. Tokens are replaced in a single pass, so a token value that itself looks like a token is written literally. A placeholder with no matching token is an error rather than something to ship. Line endings are normalized to NewLine.

Constructors

.ctor

Initializes a new instance of the EmbeddedResourceWriter class that reads the EasyAF Tools assembly’s Resources/ folder.

Syntax

Parameters

.ctor

Initializes a new instance of the EmbeddedResourceWriter class.

Syntax

Parameters

.ctor Inherited

Inherited from object

Syntax

Properties

Assembly

Gets the assembly the resources are read from.

Syntax

Property Value

Type: System.Reflection.Assembly

ResourceNames

Gets the names of the available resources, relative to EmbeddedResourceWriter.RootFolder, with forward slashes, sorted.

Syntax

Property Value

Type: System.Collections.Generic.IReadOnlyList<string>

RootFolder

Gets the logical folder that resource names are relative to (for example Resources).

Syntax

Property Value

Type: string

Tokens

Gets the tokens that replace {{Name}} placeholders.

Syntax

Property Value

Type: System.Collections.Generic.IReadOnlyDictionary<string, string>

Methods

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

Render

Renders a resource with its tokens replaced.

Syntax

Parameters

Returns

Type: string The rendered text.

Exceptions

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?

WriteAsync

Renders a resource and writes it to disk as UTF-8 without a byte order mark, creating parent directories and replacing any existing file.

Syntax

Parameters

Returns

Type: System.Threading.Tasks.Task<string> The full path of the written file.

Exceptions