Table of Contents

Class DataModelExtensions

Namespace
Nexus.DataModel
Assembly
Nexus.Extensibility.dll

Contains extension methods to make life easier working with the data model types.

public static class DataModelExtensions
Inheritance
DataModelExtensions
Inherited Members

Fields

DescriptionKey

A constant with the key for a description property.

public const string DescriptionKey = "description"

Field Value

string

GroupsKey

A constant with the key for a groups property.

public const string GroupsKey = "groups"

Field Value

string

OriginalNameKey

A constant with the key for a original name property.

public const string OriginalNameKey = "original-name"

Field Value

string

ReadmeKey

A constant with the key for a readme property.

public const string ReadmeKey = "readme"

Field Value

string

UnitKey

A constant with the key for a unit property.

public const string UnitKey = "unit"

Field Value

string

WarningKey

A constant with the key for a warning property.

public const string WarningKey = "warning"

Field Value

string

Methods

ToPath(Uri)

Converts a url into a local file path.

public static string ToPath(this Uri url)

Parameters

url Uri

The url to convert.

Returns

string

The local file path.

ToUnitString(TimeSpan)

Converts period into a human readable number string with unit.

public static string ToUnitString(this TimeSpan samplePeriod)

Parameters

samplePeriod TimeSpan

The period to convert.

Returns

string

The human readable number string with unit.

WithDescription(ResourceBuilder, string)

Adds a description.

public static ResourceBuilder WithDescription(this ResourceBuilder resourceBuilder, string description)

Parameters

resourceBuilder ResourceBuilder

The resource builder.

description string

The description to add.

Returns

ResourceBuilder

A resource builder.

WithGroups(ResourceBuilder, params string[])

Adds groups.

public static ResourceBuilder WithGroups(this ResourceBuilder resourceBuilder, params string[] groups)

Parameters

resourceBuilder ResourceBuilder

The resource builder.

groups string[]

The groups to add.

Returns

ResourceBuilder

A resource builder.

WithOriginalName(ResourceBuilder, string)

Adds an original name property.

public static ResourceBuilder WithOriginalName(this ResourceBuilder resourceBuilder, string originalName)

Parameters

resourceBuilder ResourceBuilder

The resource builder.

originalName string

The original name to add.

Returns

ResourceBuilder

A resource catalog builder.

WithReadme(ResourceCatalogBuilder, string)

Adds a readme.

public static ResourceCatalogBuilder WithReadme(this ResourceCatalogBuilder catalogBuilder, string readme)

Parameters

catalogBuilder ResourceCatalogBuilder

The catalog builder.

readme string

The markdown readme to add.

Returns

ResourceCatalogBuilder

A resource catalog builder.

WithUnit(ResourceBuilder, string)

Adds a unit.

public static ResourceBuilder WithUnit(this ResourceBuilder resourceBuilder, string unit)

Parameters

resourceBuilder ResourceBuilder

The resource builder.

unit string

The unit to add.

Returns

ResourceBuilder

A resource builder.

WithWarning(ResourceBuilder, string)

Adds a warning.

public static ResourceBuilder WithWarning(this ResourceBuilder resourceBuilder, string warning)

Parameters

resourceBuilder ResourceBuilder

The resource builder.

warning string

The warning to add.

Returns

ResourceBuilder

A resource builder.