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
GroupsKey
A constant with the key for a groups property.
public const string GroupsKey = "groups"
Field Value
OriginalNameKey
A constant with the key for a original name property.
public const string OriginalNameKey = "original-name"
Field Value
ReadmeKey
A constant with the key for a readme property.
public const string ReadmeKey = "readme"
Field Value
UnitKey
A constant with the key for a unit property.
public const string UnitKey = "unit"
Field Value
WarningKey
A constant with the key for a warning property.
public const string WarningKey = "warning"
Field Value
Methods
ToPath(Uri)
Converts a url into a local file path.
public static string ToPath(this Uri url)
Parameters
urlUriThe 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
samplePeriodTimeSpanThe 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
resourceBuilderResourceBuilderThe resource builder.
descriptionstringThe 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
resourceBuilderResourceBuilderThe resource builder.
groupsstring[]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
resourceBuilderResourceBuilderThe resource builder.
originalNamestringThe 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
catalogBuilderResourceCatalogBuilderThe catalog builder.
readmestringThe 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
resourceBuilderResourceBuilderThe resource builder.
unitstringThe unit to add.
Returns
- ResourceBuilder
A resource builder.
WithWarning(ResourceBuilder, string)
Adds a warning.
public static ResourceBuilder WithWarning(this ResourceBuilder resourceBuilder, string warning)
Parameters
resourceBuilderResourceBuilderThe resource builder.
warningstringThe warning to add.
Returns
- ResourceBuilder
A resource builder.