Skip to content

Predefined Formatter

JPVenson edited this page Nov 27, 2021 · 18 revisions

Morestachio brings (298) predefined formatter, (5) constants and (7) services to build your template with most efficiency

See https://github.com/JPVenson/morestachio/wiki/Formatter#formatter-framework for custom formatters.

Please note that this section of the wiki is autogenerated via the WorkInProgress Morestachio.Runner
All PRs updating this Wiki page alone will be rejected

Note: The Dynamic Linq Formatter are only avaiable if you included the Morestachio.Linq Nuget package

To Regenerate this Documentation if you added an build-in formatter invoke "Morestachio.Runner.exe --source-type NetFunction --source-data "Morestachio.Runner.dll" --source-data-net-type "Morestachio.Runner.Program" --source-data-net-function "GetMorestachioFormatterDocumentation" --target-path "documentation-out.md" --template-data "documentation.md""
Template: https://github.com/JPVenson/morestachio/blob/master/Morestachio.Runner/documentation.md

Go to:

Constants

Constants are objects that are available like variables without you specificing them directly. For the most part, they expose some properties you can access and/or some instance formatters.

constant CurrencyHandler

Example:

{{CurrencyHandler}}

Structure:

type CurrencyHandler {

	/**
	* The Default handler that contains all system wide known currencies
	*/
	DefaultHandler: CurrencyHandler,

	/**
	* The list of all known currencies
	*/
	Currencies: IDictionary<string, Currency>,

	/**
	* A list of known conversions for Currencies
	*/
	ConversionFactors: IEnumerable<CurrencyConversion>,

	/**
	* Converts a money object using an currency and the current known conversion factors
	*/
	function Convert(one: Money, toCurrency: Currency): Money,
}
type Money {

	/**
	* The monetary value
	*/
	Value: Number,

	/**
	* The values currency
	*/
	Currency: Currency,
}
type Number {

	/**
	* Contains the numeric value
	*/
	Value: IConvertible,
}
type Currency {

	/**
	* The Symbol that represents the current currency
	*/
	DisplayValue: string,

	/**
	* The ISO4217 currency name
	*/
	IsoName: string,
}
type CurrencyConversion {

	/**
	* One part of currency
	*/
	FromCurrency: Currency,

	/**
	* One part of currency
	*/
	ToCurrency: Currency,

	/**
	* The factor of the conversion. Can be inverted to use in ToCurrency -> FromCurrency
	*/
	Factor: double,
}

constant Currencies

Example:

{{Currencies}}

Currencies is a WellKnownCurrencies
Structure:

type WellKnownCurrencies {

	/**
	* Gets the US-Doller Currency type denoted in $
	*/
	USD: Currency,

	/**
	* Gets the European Currency type denoted in €
	*/
	EUR: Currency,

	/**
	* Gets the Russian Federations Currency type denoted in RUB
	*/
	RUB: Currency,

	/**
	* Gets the Indian Currency type denoted in ₹
	*/
	INR: Currency,

	/**
	* Gets the People's Republic of China Currency type denoted in ¥
	*/
	CNY: Currency,

	/**
	* Gets the Great British Currency type denoted in £
	*/
	GBP: Currency,

	/**
	* Gets the Japanese Currency type denoted in ¥
	*/
	JPY: Currency,
}
type Currency {

	/**
	* The Symbol that represents the current currency
	*/
	DisplayValue: string,

	/**
	* The ISO4217 currency name
	*/
	IsoName: string,
}

constant DateTime

Example:

{{DateTime}}

DateTime is a DateTimeConstant
Structure:

type DateTimeConstant {

	/**
	* Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
	*/
	Now: DateTime,

	/**
	* Gets the current date.
	*/
	Today: DateTime,

	/**
	* Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).
	*/
	UtcNow: DateTime,

	/**
	* Gets a DateTime object that is set to the current date and time on this computer, expressed as the local time.
	*/
	OffsetNow: DateTimeOffset,

	/**
	* Gets a DateTime object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC).
	*/
	OffsetUtcNow: DateTimeOffset,
}

constant Encoding

Example:

{{Encoding}}

Encoding is a EncodingConstant
Structure:

type EncodingConstant {

	/**
	* Gets an encoding for the ASCII (7-bit) character set.
	*/
	ASCII: Encoding,

	/**
	* Gets an encoding for the UTF-16 format that uses the big endian byte order.
	*/
	BigEndianUnicode: Encoding,

	/**
	* Gets an encoding for the operating system's current ANSI code page.
	*/
	Default: Encoding,

	/**
	* Gets an encoding for the UTF-16 format using the little endian byte order.
	*/
	Unicode: Encoding,

	/**
	* Gets an encoding for the UTF-32 format using the little endian byte order.
	*/
	UTF32: Encoding,

	/**
	* Gets an encoding for the UTF-7 format.
	*/
	UTF7: Encoding,

	/**
	* Gets an encoding for the UTF-8 format.
	*/
	UTF8: Encoding,
}
type Encoding {
	Preamble: ReadOnlySpan<byte>,
	BodyName: string,
	EncodingName: string,
	HeaderName: string,
	WebName: string,
	WindowsCodePage: int,
	IsBrowserDisplay: bool,
	IsBrowserSave: bool,
	IsMailNewsDisplay: bool,
	IsMailNewsSave: bool,
	IsSingleByte: bool,
	EncoderFallback: EncoderFallback,
	DecoderFallback: DecoderFallback,
	IsReadOnly: bool,
	CodePage: int,

	/**
	* When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string.
	*/
	function GetByteCount(s: string): int,

	/**
	* When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes.
	*/
	function GetBytes(s: string): byte[],

	/**
	* When overridden in a derived class, decodes all the bytes in the specified byte array into a string.
	*/
	function GetString(bytes: byte[]): string,
}

constant FileSystem

Example:

{{FileSystem}}

FileSystem is a FileSystemService

Must be enabled with FileSystemExtensions.RegisterFileSystem before available

Structure:

/**
* Must be enabled with FileSystemExtensions.RegisterFileSystem before available
*/
type FileSystemService {
	File: FileSystemFileService,
}
type FileSystemFileService {

	/**
	* Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
	*/
	function AppendAllText(path: string, contents: string, encoding: Encoding): Void,

	/**
	* Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
	*/
	function Copy(sourceFileName: string, destinationFileName: string, overwrite: bool): Void,

	/**
	* Creates or overwrites a file in the specified path.
	*/
	function Create(fileName: string): Void,

	/**
	* Deletes the specified file.
	*/
	function Delete(fileName: string): Void,

	/**
	* Determines whether the specified file exists.
	*/
	function Exists(fileName: string): bool,

	/**
	* Returns the creation date and time of the specified file or directory.
	*/
	function GetCreationTime(fileName: string): DateTime,

	/**
	* Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
	*/
	function GetCreationTimeUtc(fileName: string): DateTime,

	/**
	* Returns the date and time the specified file or directory was last accessed.
	*/
	function GetLastAccessTime(fileName: string): DateTime,

	/**
	* Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
	*/
	function GetLastAccessTimeUtc(fileName: string): DateTime,

	/**
	* Returns the date and time the specified file or directory was last written to.
	*/
	function GetLastWriteTime(fileName: string): DateTime,

	/**
	* Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
	*/
	function GetLastWriteTimeUtc(fileName: string): DateTime,

	/**
	* Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file if it already exists.
	*/
	function Move(sourceFileName: string, destinationFileName: string): Void,

	/**
	* Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
	*/
	function ReadAllBytes(fileName: string): byte[],

	/**
	* Opens a text file, reads all the text in the file, and then closes the file.
	*/
	function ReadAllText(fileName: string, encoding: Encoding): string,

	/**
	* Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
	*/
	function ReadAllTextLines(fileName: string, encoding: Encoding): string[],
}

Services

Services are availble for your formatters to inject but can also directly invoked from your template via the $services variable.

service HashService

Example:

{{$services.HashService}}

Structure:

type HashService {
	Md5: HashAlgorithm,
	Sha1: HashAlgorithm,
	Sha256: HashAlgorithm,
	Sha384: HashAlgorithm,
	Sha512: HashAlgorithm,

	/**
	* Hashes the argument with the set HashAlgorithm
	*/
	function HashWith(hashAlgorithm: HashAlgorithm, data: byte[]): byte[],

	/**
	* Hashes the argument with the set HashAlgorithm and the set Encoding
	*/
	function HashWith(hashAlgorithm: HashAlgorithm, data: string, encoding: Encoding): byte[],

	/**
	* Hashes the argument with Md5
	*/
	function HashWithMd5(data: byte[]): byte[],

	/**
	* Hashes the argument with Sha1
	*/
	function HashWithSha1(data: byte[]): byte[],

	/**
	* Hashes the argument with Sha256
	*/
	function HashWithSha256(data: byte[]): byte[],

	/**
	* Hashes the argument with Sha384
	*/
	function HashWithSha384(data: byte[]): byte[],

	/**
	* Hashes the argument with Sha512
	*/
	function HashWithSha512(data: byte[]): byte[],

	/**
	* Hashes the argument as UTF8 with Md5
	*/
	function HashWithMd5Utf8(data: string): byte[],

	/**
	* Hashes the argument as UTF8 with Sha1
	*/
	function HashWithSha1Utf8(data: string): byte[],

	/**
	* Hashes the argument as UTF8 with Sha256
	*/
	function HashWithSha256Utf8(data: string): byte[],

	/**
	* Hashes the argument as UTF8 with Sha384
	*/
	function HashWithSha384Utf8(data: string): byte[],

	/**
	* Hashes the argument as UTF8 with Sha512
	*/
	function HashWithSha512Utf8(data: string): byte[],
}

service CryptService

Example:

{{$services.CryptService}}

Structure:

type CryptService {
	Aes: IMorestachioCryptographyService,
}
type IMorestachioCryptographyService {
	Name: string,

	/**
	* Encrypts the byte[] using the password byte[]. Hint: use the {{Encoding}} constant to convert a string to a byte[]
	*/
	function Encrypt(value: byte[], password: byte[]): byte[],

	/**
	* Decrypts the byte[] using the password byte[]. Hint: use the {{Encoding}} constant to convert a string to a byte[]
	*/
	function Decrypt(value: byte[], password: byte[]): byte[],
}

service Localization

Example:

{{$services.Localization}}

Localization is a IMorestachioLocalizationService
Structure:

type IMorestachioLocalizationService {
}

service FileSystem

Example:

{{$services.FileSystem}}

FileSystem is a FileSystemService

Must be enabled with FileSystemExtensions.RegisterFileSystem before available

Structure:

/**
* Must be enabled with FileSystemExtensions.RegisterFileSystem before available
*/
type FileSystemService {
	File: FileSystemFileService,
}
type FileSystemFileService {

	/**
	* Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
	*/
	function AppendAllText(path: string, contents: string, encoding: Encoding): Void,

	/**
	* Copies an existing file to a new file. Overwriting a file of the same name is not allowed.
	*/
	function Copy(sourceFileName: string, destinationFileName: string, overwrite: bool): Void,

	/**
	* Creates or overwrites a file in the specified path.
	*/
	function Create(fileName: string): Void,

	/**
	* Deletes the specified file.
	*/
	function Delete(fileName: string): Void,

	/**
	* Determines whether the specified file exists.
	*/
	function Exists(fileName: string): bool,

	/**
	* Returns the creation date and time of the specified file or directory.
	*/
	function GetCreationTime(fileName: string): DateTime,

	/**
	* Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory.
	*/
	function GetCreationTimeUtc(fileName: string): DateTime,

	/**
	* Returns the date and time the specified file or directory was last accessed.
	*/
	function GetLastAccessTime(fileName: string): DateTime,

	/**
	* Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed.
	*/
	function GetLastAccessTimeUtc(fileName: string): DateTime,

	/**
	* Returns the date and time the specified file or directory was last written to.
	*/
	function GetLastWriteTime(fileName: string): DateTime,

	/**
	* Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to.
	*/
	function GetLastWriteTimeUtc(fileName: string): DateTime,

	/**
	* Moves a specified file to a new location, providing the options to specify a new file name and to overwrite the destination file if it already exists.
	*/
	function Move(sourceFileName: string, destinationFileName: string): Void,

	/**
	* Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
	*/
	function ReadAllBytes(fileName: string): byte[],

	/**
	* Opens a text file, reads all the text in the file, and then closes the file.
	*/
	function ReadAllText(fileName: string, encoding: Encoding): string,

	/**
	* Opens a file, reads all lines of the file with the specified encoding, and then closes the file.
	*/
	function ReadAllTextLines(fileName: string, encoding: Encoding): string[],
}

service Formatters

Example:

{{$services.Formatters}}

Formatters is a IMorestachioFormatterService
Structure:

type IMorestachioFormatterService {
	Constants: IDictionary<string, object>,
	Services: ServiceCollection,
	AllParametersAllDefaultValue: bool,
	ValueConverter: IEnumerable<IFormatterValueConverter>,
}
type ServiceCollection {
}
type IFormatterValueConverter {
}

service IServiceContainer

Example:

{{$services.IServiceContainer}}

Structure:

type IServiceContainer {
}

service ServiceCollection

Example:

{{$services.ServiceCollection}}

Structure:

type ServiceCollection {
}

Formatters

Formatters are extensions for your data and can be invoked on the SourceObject with the given set of arguments

class LocalizationFormatter

LocalizationFormatter.Inflect

Example: Inflect(Number count, string singular, string plural, bool includeCount)
FormatterName: Inflect
Arguments:

  • Number: count
  • string: singular
  • string: plural
  • bool: includeCount

Returns: string
Description:

Returns either the singular or plural inflection of a word based on the given count

Must be Setup using the IMorestachioLocalizationService service

LocalizationFormatter.Translate

Example: Loc(string key, object[] arguments)
FormatterName: Loc
Arguments:

  • string: key
  • [RestParameter] object[]: arguments

Returns: object
Description:

Translates the given key in the current Culture

Must be Setup using the IMorestachioLocalizationService service

LocalizationFormatter.Translate

Example: (string).Loc(object[] arguments)
FormatterName: Loc
Arguments:

  • [SourceObject] string: key
  • [RestParameter] object[]: arguments

Returns: object
Description:

Translates the given key in the current Culture

Must be Setup using the IMorestachioLocalizationService service

class ObjectFormatter

ObjectFormatter.AsObject

Example: (IDictionary<string, object>).AsObject()
FormatterName: AsObject
Arguments:

  • [SourceObject] IDictionary<string, object>: value

Returns: object
Description:

Wraps an IDictionary as an object

ObjectFormatter.AsObject

Example: AsObject(IDictionary<string, object> value)
FormatterName: AsObject
Arguments:

  • IDictionary<string, object>: value

Returns: object
Description:

Wraps an IDictionary as an object

ObjectFormatter.Call

Example: (object).Call(string formatterName, object[] arguments)
FormatterName: Call
Arguments:

  • [SourceObject] object: source
  • string: formatterName
  • [RestParameter] object[]: arguments

Returns: Task<object>
Description:

Calls a formatter by dynamically providing name and arguments

ObjectFormatter.Combine

Example: (IDictionary<T, TE>).Combine(IDictionary<T, TE> other)
FormatterName: Combine
Arguments:

  • [SourceObject] IDictionary<T, TE>: source
  • IDictionary<T, TE>: other

Returns: IDictionary<T, TE>
Description:

Combines two objects together were the other one overwrites any value from the source in the new object

ObjectFormatter.Formattable

Example: (IFormattable).ToString(string argument)
FormatterName: ToString
Arguments:

  • [SourceObject] IFormattable: source
  • string: argument

Returns: string
Description:

Formats a value according to the structure set by the argument

ObjectFormatter.Formattable

Example: (object).ToString()
FormatterName: ToString
Arguments:

  • [SourceObject] object: source

Returns: string
Description:

Formats the value according to the build in rules for that object

ObjectFormatter.FormatType

Example: (Type).TypeName()
FormatterName: TypeName
Arguments:

  • [SourceObject] Type: type

Returns: string
Description:

Formats a Type according to the structure set by the argument

ObjectFormatter.Get

Example: (object).Get(string propertyName)
FormatterName: Get
Arguments:

  • [SourceObject] object: source
  • string: propertyName

Returns: object
Description:

Gets a specific property from an object or IDictionary

ObjectFormatter.New

Example: new(FormatterParameterList values)
FormatterName: new
Arguments:

  • [RestParameter] FormatterParameterList: values

Returns: object
Description:

Creates a new object from given parameters with names. Example: {{new([Name]"Test", [Age] 57, [Gender] Genders.Male)}}

ObjectFormatter.ToXml

Example: (object).ToXml()
FormatterName: ToXml
Arguments:

  • [SourceObject] object: source

Returns: string

class Number

Number.Abs

Example: (Number).Abs()
FormatterName: Abs
Arguments:

  • [SourceObject] Number: left

Returns: Number
Description:

Gets the Absolute value

Number.Add

Example: (Number).Add(Number right)
FormatterName: Add | Plus | +
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Adds two numbers

Number.Divide

Example: (Number).Divide(Number right)
FormatterName: Divide | /
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Divides two numbers

Number.Equals

Example: (Number).Equals(Number right)
FormatterName: Equals | ==
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the two numbers are equal to each other

Number.GreaterOrEquals

Example: (Number).GreaterOrEquals(Number right)
FormatterName: GreaterOrEquals | >=
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the source number is bigger as the other number

Number.GreaterThen

Example: (Number).BiggerAs(Number right)
FormatterName: BiggerAs | GreaterThen | >
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the source number is bigger as the other number

Number.IsNaN

Example: (Number).IsNaN()
FormatterName: IsNaN
Arguments:

  • [SourceObject] Number: left

Returns: bool
Description:

Gets if the current number object is not a number

Number.LessThen

Example: (Number).SmallerAs(Number right)
FormatterName: SmallerAs | SmallerThan | LessThen | <
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the source number is smaller as the other number

Number.Log

Example: (Number).Log(Number right)
FormatterName: Log
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number

Number.Max

Example: (Number).Max(Number right)
FormatterName: Max | <?
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Returns the bigger of the two numbers

Number.Min

Example: (Number).Min(Number right)
FormatterName: Min | >?
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Returns the smaller of the two numbers

Number.Modulo

Example: (Number).Modulo(Number right)
FormatterName: Modulo | %
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Modulo two numbers

Number.Multiply

Example: (Number).Multiply(Number right)
FormatterName: Multiply | *
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Multiplies two numbers

Number.Negate

Example: (Number).Negate()
FormatterName: Negate
Arguments:

  • [SourceObject] Number: left

Returns: Number
Description:

Negates the current value

Number.Parse

Example: ParseNumber(string text)
FormatterName: ParseNumber
Arguments:

  • string: text

Returns: Number
Description:

Parses a string into a number. Returns NaN if invalid

Number.Pow

Example: (Number).Pow(Number right)
FormatterName: Pow | ^
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Gets this number power the times of the other number

Number.Round

Example: (Number).Round(Number right)
FormatterName: Round
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Rounds a double-precision floating-point value to a specified number of fractional digits.

Number.Same

Example: (Number).Same(Number right)
FormatterName: Same
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the two numbers are the same

Number.ShiftLeft

Example: (Number).ShiftLeft(Number right)
FormatterName: ShiftLeft | <<
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Shift two numbers

Number.ShiftRight

Example: (Number).ShiftRight(Number right)
FormatterName: ShiftRight | >>
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Shift two numbers

Number.SmallerOrEquals

Example: (Number).SmallerOrEquals(Number right)
FormatterName: SmallerOrEquals | <=
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the source number is smaller as the other number

Number.Subtract

Example: (Number).Subtract(Number right)
FormatterName: Subtract | Minus | -
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: Number
Description:

Subtracts two numbers

Number.ToBytes

Example: (Number).ToBytes(Number? decimalPlaces)
FormatterName: ToBytes
Arguments:

  • [SourceObject] Number: value
  • Number?``[Optional]: decimalPlaces

Returns: string
Description:

Format a number to it's equivalent in bytes.

Number.UnEquals

Example: (Number).UnEquals(Number right)
FormatterName: UnEquals | !=
Arguments:

  • [SourceObject] Number: left
  • Number: right

Returns: bool
Description:

Checks if the two numbers are equal to each other

class DateFormatter

DateFormatter.Add

Example: (DateTime).Add(TimeSpan timespan)
FormatterName: Add | +
Arguments:

  • [SourceObject] DateTime: dateTime
  • TimeSpan: timespan

Returns: DateTime
Description:

Adds the TimeSpan to the given DateTime

DateFormatter.Add

Example: (DateTimeOffset).Add(TimeSpan timespan)
FormatterName: Add | +
Arguments:

  • [SourceObject] DateTimeOffset: dateTime
  • TimeSpan: timespan

Returns: DateTimeOffset
Description:

Adds the TimeSpan to the given DateTime

DateFormatter.DateTimeNow

Example: DateTimeNow()
FormatterName: DateTimeNow

Returns: DateTime
Description:

Gets a DateTime object representing the current time

DateFormatter.DateTimeOffsetNow

Example: DateTimeOffsetNow()
FormatterName: DateTimeOffsetNow

Returns: DateTimeOffset
Description:

Gets a DateTime object representing the current time

DateFormatter.DaysInMonth

Example: DaysInMonth(Number year, Number month)
FormatterName: DaysInMonth
Arguments:

  • Number: year
  • Number: month

Returns: int
Description:

Gets the Days in a given Month of the year

DateFormatter.IsLeapYear

Example: IsLeapYear(Number year)
FormatterName: IsLeapYear
Arguments:

  • Number: year

Returns: bool
Description:

Gets if the given year is a leap year

DateFormatter.Parse

Example: (string).ToDateTime()
FormatterName: ToDateTime
Arguments:

  • [SourceObject] string: text

Returns: DateTime
Description:

Converts the string representation of a date and time to its DateTime equivalent.

DateFormatter.Parse

Example: DateTime(string text)
FormatterName: DateTime
Arguments:

  • string: text

Returns: DateTime
Description:

Converts the string representation of a date and time to its DateTime equivalent.

DateFormatter.ParseDateTimeOffset

Example: (string).ToDateTimeOffset()
FormatterName: ToDateTimeOffset
Arguments:

  • [SourceObject] string: text

Returns: DateTimeOffset
Description:

Converts the string representation of a date and time to its DateTime equivalent.

DateFormatter.ParseDateTimeOffset

Example: DateTimeOffset(string text)
FormatterName: DateTimeOffset
Arguments:

  • string: text

Returns: DateTimeOffset
Description:

Converts the string representation of a date and time to its DateTime equivalent.

DateFormatter.ParseExact

Example: (string).ToExactDateTime(string format)
FormatterName: ToExactDateTime
Arguments:

  • [SourceObject] string: text
  • string: format

Returns: DateTime
Description:

Converts the string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

DateFormatter.ParseExact

Example: ExactDateTime(string text, string format)
FormatterName: ExactDateTime
Arguments:

  • string: text
  • string: format

Returns: DateTime
Description:

Converts the string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

DateFormatter.ParseExactDateTimeOffset

Example: (string).ToExactDateTimeOffset(string format)
FormatterName: ToExactDateTimeOffset
Arguments:

  • [SourceObject] string: text
  • string: format

Returns: DateTimeOffset
Description:

Converts the string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

DateFormatter.ParseExactDateTimeOffset

Example: ExactDateTimeOffset(string text, string format)
FormatterName: ExactDateTimeOffset
Arguments:

  • string: text
  • string: format

Returns: DateTimeOffset
Description:

Converts the string representation of a date and time to its DateTime equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly.

DateFormatter.WeekOfDate

Example: (DateTimeOffset).WeekOfDate()
FormatterName: WeekOfDate
Arguments:

  • [SourceObject] DateTimeOffset: time

Returns: int
Description:

Gets the week of the given DateTime

DateFormatter.WeekOfDate

Example: (DateTime).WeekOfDate()
FormatterName: WeekOfDate
Arguments:

  • [SourceObject] DateTime: time

Returns: int
Description:

Gets the week of the given DateTime

class ListExtensions

ListExtensions.Add

Example: (IList<T>).Add(object[] toBeAdded)
FormatterName: Add
Arguments:

  • [SourceObject] IList<T>: sourceCollection
  • [RestParameter] object[]: toBeAdded

Returns: IList<T>
Description:

Adds the values to the SourceCollection

ListExtensions.Aggregate

Example: (IEnumerable<T>).Aggregate(MorestachioTemplateExpression expression)
FormatterName: Aggregate
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Counts all items that matches the predicate

ListExtensions.Aggregate

Example: (IEnumerable<T>).ToArray()
FormatterName: ToArray
Arguments:

  • [SourceObject] IEnumerable<T>: items

Returns: T[]
Description:

Enumerates the list of items to a fixed size array

ListExtensions.All

Example: (IEnumerable<T>).All(MorestachioTemplateExpression expression)
FormatterName: All
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: bool
Description:

returns if All elements in the collection matches the condition

ListExtensions.Any

Example: (IEnumerable<T>).Any(MorestachioTemplateExpression expression)
FormatterName: Any
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: bool
Description:

returns if Any elements in the collection matches the condition

ListExtensions.Count

Example: (IEnumerable<T>).Count(MorestachioTemplateExpression expression)
FormatterName: Count
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: int
Description:

Counts all items that matches the predicate

ListExtensions.First

Example: (IEnumerable<T>).First(MorestachioTemplateExpression expression)
FormatterName: First
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Selected the first item that matches the condition

ListExtensions.FirstOrDefault

Example: (IEnumerable<T>).FirstOrDefault(MorestachioTemplateExpression expression)
FormatterName: FirstOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Selected the first item that matches the condition

ListExtensions.GroupBy

Example: (IEnumerable<T>).GroupBy(MorestachioTemplateExpression expression)
FormatterName: GroupBy
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<IGrouping<TE, T>>
Description:

Groups a list

ListExtensions.Insert

Example: (IList<T>).Insert(int index, object[] toBeInserted)
FormatterName: Insert
Arguments:

  • [SourceObject] IList<T>: sourceCollection
  • int: index
  • [RestParameter] object[]: toBeInserted

Returns: IList<T>
Description:

Inserts a value at the specified index in the SourceCollection.

ListExtensions.Last

Example: (IEnumerable<T>).Last(MorestachioTemplateExpression expression)
FormatterName: Last
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Gets the Last item in the list that matches the predicate

ListExtensions.LastOrDefault

Example: (IEnumerable<T>).Last(MorestachioTemplateExpression expression)
FormatterName: Last
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Gets the Last item in the list that matches the predicate

ListExtensions.OrderBy

Example: (IEnumerable<T>).OrderBy(MorestachioTemplateExpression expression)
FormatterName: OrderBy
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<T>
Description:

Orders the list descending

ListExtensions.OrderBy

Example: (IEnumerable<T>).OrderBy()
FormatterName: OrderBy
Arguments:

  • [SourceObject] IEnumerable<T>: items

Returns: IEnumerable<T>
Description:

Orders the list descending

ListExtensions.Remove

Example: (IList<T>).Remove(object[] toBeRemoved)
FormatterName: Remove
Arguments:

  • [SourceObject] IList<T>: sourceCollection
  • [RestParameter] object[]: toBeRemoved

Returns: IList<T>
Description:

Removes an element from the SourceCollection

ListExtensions.RemoveAt

Example: (IList<T>).RemoveAt(int index)
FormatterName: RemoveAt
Arguments:

  • [SourceObject] IList<T>: sourceCollection
  • int: index

Returns: IList<T>
Description:

Removes an element at the specified index from the input list

ListExtensions.Select

Example: (IEnumerable<T>).Select(MorestachioTemplateExpression expression)
FormatterName: Select
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<TE>
Description:

Selects items from the collection based on the predicate

ListExtensions.SelectMany

Example: (IEnumerable<T>).SelectMany(MorestachioTemplateExpression expression)
FormatterName: SelectMany
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<TE>
Description:

Selects a list of items from the collection based on the predicate and flattens them

ListExtensions.Single

Example: (IEnumerable<T>).Single(MorestachioTemplateExpression expression)
FormatterName: Single
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Gets the only item in the list that matches the predicate

ListExtensions.SingleOrDefault

Example: (IEnumerable<T>).SingleOrDefault()
FormatterName: SingleOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: items

Returns: T
Description:

Gets the only item in the list that matches the predicate

ListExtensions.SingleOrDefault

Example: (IEnumerable<T>).SingleOrDefault(MorestachioTemplateExpression expression)
FormatterName: SingleOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: T
Description:

Gets the only item in the list that matches the predicate

ListExtensions.SkipWhile

Example: (IEnumerable<T>).SkipWhile(MorestachioTemplateExpression expression)
FormatterName: SkipWhile
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<T>
Description:

Skips items from the collection as long as the predicate is true

ListExtensions.TakeWhile

Example: (IEnumerable<T>).TakeWhile(MorestachioTemplateExpression expression)
FormatterName: TakeWhile
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<T>
Description:

Takes items from the collection as long as the predicate is true

ListExtensions.ThenBy

Example: (IOrderedEnumerable<T>).ThenBy()
FormatterName: ThenBy
Arguments:

  • [SourceObject] IOrderedEnumerable<T>: items

Returns: IEnumerable<T>
Description:

Orders the list descending

ListExtensions.ThenBy

Example: (IOrderedEnumerable<T>).ThenBy(MorestachioTemplateExpression expression)
FormatterName: ThenBy
Arguments:

  • [SourceObject] IOrderedEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<T>
Description:

Orders the list descending

ListExtensions.ToList

Example: ToList(object[] items)
FormatterName: ToList
Arguments:

  • [RestParameter] object[]: items

Returns: IList<T>
Description:

Gets any number of elements and returns a new list containing those elements

ListExtensions.Where

Example: (IEnumerable<T>).Where(MorestachioTemplateExpression expression)
FormatterName: Where
Arguments:

  • [SourceObject] IEnumerable<T>: items
  • MorestachioTemplateExpression: expression

Returns: IEnumerable<T>
Description:

Filteres the collection based on the predicate

ListExtensions.With

Example: With(object[] toBeAdded)
FormatterName: With
Arguments:

  • [RestParameter] object[]: toBeAdded

Returns: IList
Description:

Creates a new List object with the given values

class TimeSpanFormatter

TimeSpanFormatter.Add

Example: (TimeSpan).Add(TimeSpan timespan)
FormatterName: Add | +
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: TimeSpan
Description:

Adds the TimeSpan to the given TimeSpan

TimeSpanFormatter.Divide

Example: (TimeSpan).Divide(Number factor)
FormatterName: Divide | /
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • Number: factor

Returns: TimeSpan
Description:

Divides the TimeSpan to the given Number

TimeSpanFormatter.Equals

Example: (TimeSpan).Equals(TimeSpan timespan)
FormatterName: Equals | ==
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the two TimeSpan are equal to each other

TimeSpanFormatter.FromDays

Example: (Number).TimeSpanFromDays()
FormatterName: TimeSpanFromDays
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Days into a TimeSpan

TimeSpanFormatter.FromDays

Example: TimeSpanFromDays(Number days)
FormatterName: TimeSpanFromDays
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Days into a TimeSpan

TimeSpanFormatter.FromHours

Example: (Number).TimeSpanFromHours()
FormatterName: TimeSpanFromHours
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Hours into a TimeSpan

TimeSpanFormatter.FromHours

Example: TimeSpanFromHours(Number days)
FormatterName: TimeSpanFromHours
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Hours into a TimeSpan

TimeSpanFormatter.FromMilliseconds

Example: (Number).TimeSpanFromMilliseconds()
FormatterName: TimeSpanFromMilliseconds
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Milliseconds into a TimeSpan

TimeSpanFormatter.FromMilliseconds

Example: TimeSpanFromMilliseconds(Number days)
FormatterName: TimeSpanFromMilliseconds
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Milliseconds into a TimeSpan

TimeSpanFormatter.FromMinutes

Example: (Number).TimeSpanFromMinutes()
FormatterName: TimeSpanFromMinutes
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Minutes into a TimeSpan

TimeSpanFormatter.FromMinutes

Example: TimeSpanFromMinutes(Number days)
FormatterName: TimeSpanFromMinutes
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Minutes into a TimeSpan

TimeSpanFormatter.FromSeconds

Example: (Number).TimeSpanFromSeconds()
FormatterName: TimeSpanFromSeconds
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Seconds into a TimeSpan

TimeSpanFormatter.FromSeconds

Example: TimeSpanFromSeconds(Number days)
FormatterName: TimeSpanFromSeconds
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Seconds into a TimeSpan

TimeSpanFormatter.FromTicks

Example: (Number).TimeSpanFromTicks()
FormatterName: TimeSpanFromTicks
Arguments:

  • [SourceObject] Number: days

Returns: TimeSpan
Description:

Parses a number of Ticks into a TimeSpan

TimeSpanFormatter.FromTicks

Example: TimeSpanFromTicks(Number days)
FormatterName: TimeSpanFromTicks
Arguments:

  • Number: days

Returns: TimeSpan
Description:

Parses a number of Ticks into a TimeSpan

TimeSpanFormatter.GreaterOrEquals

Example: (TimeSpan).GreaterOrEquals(TimeSpan timespan)
FormatterName: GreaterOrEquals | >=
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the source TimeSpan is bigger or equals as the other TimeSpan

TimeSpanFormatter.GreaterThen

Example: (TimeSpan).GreaterThen(TimeSpan timespan)
FormatterName: GreaterThen | >
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the source TimeSpan is bigger as the other TimeSpan

TimeSpanFormatter.LessOrEquals

Example: (TimeSpan).LessOrEquals(TimeSpan timespan)
FormatterName: <= | LessOrEquals
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the source TimeSpan is bigger as the other TimeSpan

TimeSpanFormatter.LessThen

Example: (TimeSpan).LessThen(TimeSpan timespan)
FormatterName: LessThen | <
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the source TimeSpan is smaller as the other TimeSpan

TimeSpanFormatter.Multiply

Example: (TimeSpan).Multiply(Number factor)
FormatterName: Multiply | *
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • Number: factor

Returns: TimeSpan
Description:

Multiplies the TimeSpan to the given Number

TimeSpanFormatter.Negate

Example: (TimeSpan).Negate()
FormatterName: Negate
Arguments:

  • [SourceObject] TimeSpan: timeSpan

Returns: TimeSpan
Description:

Negate the value of an TimeSpan

TimeSpanFormatter.ParseTimeSpan

Example: (string).ToTimeSpan()
FormatterName: ToTimeSpan
Arguments:

  • [SourceObject] string: timespan

Returns: TimeSpan
Description:

Parses a string into a TimeSpan

TimeSpanFormatter.ParseTimeSpan

Example: TimeSpan(string timespan)
FormatterName: TimeSpan
Arguments:

  • string: timespan

Returns: TimeSpan
Description:

Parses a string into a TimeSpan

TimeSpanFormatter.ParseTimeSpanExact

Example: (string).ToTimeSpanExact(string format)
FormatterName: ToTimeSpanExact
Arguments:

  • [SourceObject] string: timespan
  • string: format

Returns: TimeSpan
Description:

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified format and culture-specific format information.

TimeSpanFormatter.ParseTimeSpanExact

Example: TimeSpanExact(string timespan, string format)
FormatterName: TimeSpanExact
Arguments:

  • string: timespan
  • string: format

Returns: TimeSpan
Description:

Converts the string representation of a time interval to its TimeSpan equivalent by using the specified format and culture-specific format information.

TimeSpanFormatter.Subtract

Example: (TimeSpan).Subtract(TimeSpan timespan)
FormatterName: Subtract | -
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: TimeSpan
Description:

Subtracts the TimeSpan to the given TimeSpan

TimeSpanFormatter.UnEquals

Example: (TimeSpan).UnEquals(TimeSpan timespan)
FormatterName: UnEquals | !=
Arguments:

  • [SourceObject] TimeSpan: timeSpan
  • TimeSpan: timespan

Returns: bool
Description:

Checks if the two TimeSpan are not equal to each other

class Worktime

Worktime.Add

Example: (Worktime).Add(Worktime other)
FormatterName: Add
Arguments:

  • [SourceObject] Worktime: worktime
  • Worktime: other

Returns: Worktime
Description:

Adds both worktimes together

Worktime.AddDays

Example: (Worktime).AddDays(Number number)
FormatterName: AddDays
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number

Returns: Worktime
Description:

Adds the given amount of Days to the worktime

Worktime.AddHours

Example: (Worktime).AddHours(Number number)
FormatterName: AddHours
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number

Returns: Worktime
Description:

Adds the given amount of Hours to the worktime

Worktime.AddMinutes

Example: (Worktime).AddMinutes(Number number)
FormatterName: AddMinutes
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number

Returns: Worktime
Description:

Adds the given amount of Minutes to the worktime

Worktime.AddMonths

Example: (Worktime).AddMonths(Number number, DateTime startingWith)
FormatterName: AddMonths
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number
  • DateTime: startingWith

Returns: Worktime
Description:

Adds the given amount of Months to the worktime. As all months have different days you have to specify which month to start with.

Worktime.AddSeconds

Example: (Worktime).AddSeconds(Number number)
FormatterName: AddSeconds
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number

Returns: Worktime
Description:

Adds the given amount of Seconds to the worktime

Worktime.AddWeeks

Example: (Worktime).AddWeeks(Number number)
FormatterName: AddWeeks
Arguments:

  • [SourceObject] Worktime: worktime
  • Number: number

Returns: Worktime
Description:

Adds the given amount of Weeks to the worktime

Worktime.WorktimeFactory

Example: Worktime()
FormatterName: Worktime

Returns: Worktime
Description:

Creates a new Worktime Object

Worktime.WorktimeFactory

Example: WorktimeFromTimespan(TimeSpan timespan)
FormatterName: WorktimeFromTimespan
Arguments:

  • TimeSpan: timespan

Returns: Worktime
Description:

Creates a new Worktime Object based on the Timespan

class Money

Money.Add

Example: (Money).Add(Money value)
FormatterName: Add | +
Arguments:

  • [SourceObject] Money: sourceValue
  • Money: value

Returns: Money
Description:

Adds the value to a new money object and returns it

Money.GetMoney

Example: (Worktime).GetMoney(double rate, MoneyChargeRate chargeRate)
FormatterName: GetMoney
Arguments:

  • [SourceObject] Worktime: worktime
  • double: rate
  • MoneyChargeRate: chargeRate

Returns: Money
Description:

Calculates the value of the worktime by taking the rate and chargerate

Money.GetMoney

Example: (Worktime).GetMoney(double rate, MoneyChargeRate chargeRate, Currency currency)
FormatterName: GetMoney
Arguments:

  • [SourceObject] Worktime: worktime
  • double: rate
  • MoneyChargeRate: chargeRate
  • Currency: currency

Returns: Money
Description:

Calculates the value of the worktime by taking the rate and chargerate

Money.GetTax

Example: (Money).GetTax(double value)
FormatterName: GetTax
Arguments:

  • [SourceObject] Money: worktime
  • double: value

Returns: Money
Description:

Gets the amount of Tax for this money object

Money.MoneyFactory

Example: Money(Number value)
FormatterName: Money
Arguments:

  • Number: value

Returns: Money
Description:

Creates a new Money Object

Money.MoneyFactory

Example: Money(Number value, Currency currency)
FormatterName: Money
Arguments:

  • Number: value
  • Currency: currency

Returns: Money
Description:

Creates a new Money Object

Money.Parse

Example: ParseMoney(string text, CurrencyHandler handler)
FormatterName: ParseMoney
Arguments:

  • string: text
  • CurrencyHandler``[Optional]: handler

Returns: Money
Description:

Parses a string to a money object

Money.Round

Example: (Money).Round()
FormatterName: Round
Arguments:

  • [SourceObject] Money: worktime

Returns: Money
Description:

Rounds the value using common commercial rules IEEE 754

Money.Subtract

Example: (Money).Substract(Money value)
FormatterName: - | Substract
Arguments:

  • [SourceObject] Money: sourceValue
  • Money: value

Returns: Money
Description:

Substracts the value to a new money object and returns it

class StringFormatter

StringFormatter.Append

Example: (string).Append(string target)
FormatterName: + | Append
Arguments:

  • [SourceObject] string: source
  • string: target

Returns: string
Description:

Concatenates two strings

StringFormatter.Append

Example: (object source) + (string target)
FormatterName: +
Arguments:

  • [SourceObject] object: source
  • string: target

Returns: string
Description:

Concatenates two strings

StringFormatter.Append

Example: (string source) + (object target)
FormatterName: +
Arguments:

  • [SourceObject] string: source
  • object: target

Returns: string
Description:

Concatenates two strings

StringFormatter.AsAscii

Example: (string).AsAscii()
FormatterName: AsAscii
Arguments:

  • [SourceObject] string: source

Returns: byte[]
Description:

Decodes the string source as an ASCII encoded byte[]

StringFormatter.AsUnicode

Example: (string).AsUnicode()
FormatterName: AsUnicode
Arguments:

  • [SourceObject] string: source

Returns: byte[]
Description:

Decodes the string source as an Unicode encoded byte[]

StringFormatter.AsUtf32

Example: (string).AsUtf32()
FormatterName: AsUtf32
Arguments:

  • [SourceObject] string: source

Returns: byte[]
Description:

Decodes the string source as an UTF-32 encoded byte[]

StringFormatter.AsUtf8

Example: (string).AsUtf8()
FormatterName: AsUtf8
Arguments:

  • [SourceObject] string: source

Returns: byte[]
Description:

Decodes the string source as an UTF-8 encoded byte[]

StringFormatter.Capitalize

Example: (string).Capitalize()
FormatterName: Capitalize
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Converts the first character of the passed string to a upper case character.

StringFormatter.CapitalizeWords

Example: (string).CapitalizeWords()
FormatterName: CapitalizeWords
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Converts the first character of each word in the passed string to a upper case character.

StringFormatter.Contains

Example: (string).Contains(string target)
FormatterName: Contains
Arguments:

  • [SourceObject] string: source
  • string: target

Returns: bool
Description:

Returns a boolean indicating whether the input string contains the specified string value.

StringFormatter.EndsWith

Example: (string).EndsWith(string target)
FormatterName: EndsWith
Arguments:

  • [SourceObject] string: source
  • string: target

Returns: bool
Description:

Returns a boolean indicating whether the input string ends with the specified string value.

StringFormatter.FromBase64

Example: (string).FromBase64()
FormatterName: FromBase64
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Decodes a string from its Base64 representation the decoding is expected be the same as the template

StringFormatter.Join

Example: (IEnumerable<string>).Join(string seperator)
FormatterName: Join
Arguments:

  • [SourceObject] IEnumerable<string>: source
  • string: seperator

Returns: string
Description:

Joins an Array of string together by using a seperator

StringFormatter.PadLeft

Example: (string).PadLeft(int width)
FormatterName: PadLeft
Arguments:

  • [SourceObject] string: source
  • int: width

Returns: string
Description:

Pads a string with leading spaces to a specified total length.

StringFormatter.PadRight

Example: (string).PadRight(int width)
FormatterName: PadRight
Arguments:

  • [SourceObject] string: source
  • int: width

Returns: string
Description:

Pads a string with leading spaces to a specified total length.

StringFormatter.Remove

Example: (string).Remove(int start, int count)
FormatterName: Remove
Arguments:

  • [SourceObject] string: source
  • int: start
  • int: count

Returns: string
Description:

Removes the range of substring from the string

StringFormatter.Remove

Example: (string).Remove(string search)
FormatterName: Remove
Arguments:

  • [SourceObject] string: source
  • string: search

Returns: string
Description:

Removes all occurrences of a substring from a string.

StringFormatter.Replace

Example: (string).Replace(string search, string with)
FormatterName: Replace
Arguments:

  • [SourceObject] string: source
  • string: search
  • string: with

Returns: string
Description:

Replaces all occurrences of a substring from a string.

StringFormatter.Split

Example: (string).Split(object[] delimiters)
FormatterName: Split
Arguments:

  • [SourceObject] string: source
  • [RestParameter] object[]: delimiters

Returns: string[]
Description:

Splits the string each time any delimiter is found

StringFormatter.StartsWith

Example: (string).StartsWith(string target)
FormatterName: StartsWith
Arguments:

  • [SourceObject] string: source
  • string: target

Returns: bool
Description:

Returns a boolean indicating whether the input string starts with the specified string value.

StringFormatter.Substring

Example: (string).Substring(int start, int count)
FormatterName: Substring
Arguments:

  • [SourceObject] string: source
  • int: start
  • int: count

Returns: string
Description:

The slice returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring with the remaining characters will be returned.

StringFormatter.Substring

Example: (string).Substring(int start)
FormatterName: Substring
Arguments:

  • [SourceObject] string: source
  • int: start

Returns: string
Description:

The slice returns a substring, starting at the specified index. An optional second parameter can be passed to specify the length of the substring. If no second parameter is given, a substring with the remaining characters will be returned.

StringFormatter.ToBase64

Example: (string).ToBase64()
FormatterName: ToBase64
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Encodes a string to its Base64 representation the encoding will be the same as the template

StringFormatter.ToLower

Example: (string).ToLower()
FormatterName: ToLower
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Converts the string to lower case.

StringFormatter.ToUpper

Example: (string).ToUpper()
FormatterName: ToUpper
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Converts the string to upper case.

StringFormatter.Trim

Example: (string).Trim()
FormatterName: Trim
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Trims all leading and tailing Whitespaces

StringFormatter.TrimEnd

Example: (string).TrimEnd()
FormatterName: TrimEnd
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Trims all tailing Whitespaces

StringFormatter.TrimStart

Example: (string).TrimStart()
FormatterName: TrimStart
Arguments:

  • [SourceObject] string: source

Returns: string
Description:

Trims all leading Whitespaces

StringFormatter.Truncate

Example: (string).Truncate(int length, string ellipsis)
FormatterName: Truncate
Arguments:

  • [SourceObject] string: source
  • int: length
  • string``[Optional]: ellipsis

Returns: string
Description:

Truncates a string down to the number of characters passed as the first parameter. An ellipsis (...) is appended to the truncated string and is included in the character count

class EqualityFormatter

EqualityFormatter.IsEquals

Example: (object).Equals(object target)
FormatterName: Equals | ==
Arguments:

  • [SourceObject] object: source
  • object: target

Returns: bool
Description:

Checks if two objects are equal

EqualityFormatter.IsEquals

Example: Equals(object source, object target)
FormatterName: Equals
Arguments:

  • object: source
  • object: target

Returns: bool
Description:

Checks if two objects are equal

EqualityFormatter.IsNotEquals

Example: (object source) != (object target)
FormatterName: !=
Arguments:

  • [SourceObject] object: source
  • object: target

Returns: bool
Description:

Checks if two objects are not equal

EqualityFormatter.IsReferenceEquals

Example: (object).ReferenceEquals(object target)
FormatterName: ReferenceEquals
Arguments:

  • [SourceObject] object: source
  • object: target

Returns: bool
Description:

Checks if two objects are the same

EqualityFormatter.IsReferenceEquals

Example: ReferenceEquals(object source, object target)
FormatterName: ReferenceEquals
Arguments:

  • object: source
  • object: target

Returns: bool
Description:

Checks if two objects are the same

EqualityFormatter.NullCoalescing

Example: (object).NullCoalescing(object right)
FormatterName: ?? | NullCoalescing
Arguments:

  • [SourceObject] object: left
  • object: right

Returns: object
Description:

returns the value of its left-hand operand if it isn't null; otherwise, it evaluates the right-hand operand and returns its result

EqualityFormatter.NullCoalescing

Example: NullCoalescing(object left, object right)
FormatterName: NullCoalescing
Arguments:

  • object: left
  • object: right

Returns: object
Description:

returns the value of its left-hand operand if it isn't null; otherwise, it evaluates the right-hand operand and returns its result

class BooleanFormatter

BooleanFormatter.And

Example: (bool).And(bool other)
FormatterName: And | &&
Arguments:

  • [SourceObject] bool: value
  • bool: other

Returns: bool
Description:

Returns true if all values are true

BooleanFormatter.And

Example: (bool).And(object[] values)
FormatterName: And
Arguments:

  • [SourceObject] bool: value
  • [RestParameter] object[]: values

Returns: bool
Description:

Returns true if all values are true

BooleanFormatter.Negate

Example: (bool).Negate()
FormatterName: Negate | Not | !
Arguments:

  • [SourceObject] bool: value

Returns: bool
Description:

Negates a Boolean value

BooleanFormatter.Or

Example: (bool).Or(bool other)
FormatterName: Or | ||
Arguments:

  • [SourceObject] bool: value
  • bool: other

Returns: bool
Description:

Returns true any value is true

BooleanFormatter.Or

Example: (bool).Or(object[] values)
FormatterName: Or
Arguments:

  • [SourceObject] bool: value
  • [RestParameter] object[]: values

Returns: bool
Description:

Returns true any value is true

BooleanFormatter.ParseBool

Example: (string).ParseBool()
FormatterName: ParseBool
Arguments:

  • [SourceObject] string: value

Returns: bool
Description:

Parses a boolean from string by checking for the equality of ether '1', 'yes', 'true', 'valid'

class LoggingFormatter

LoggingFormatter.Log

Example: Log(string logLevel, string eventId, string message)
FormatterName: Log
Arguments:

  • string: logLevel
  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogCritical

Example: LogCritical(string eventId, string message)
FormatterName: LogCritical
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogDebug

Example: LogDebug(string eventId, string message)
FormatterName: LogDebug
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogDisable

Example: LogDisable()
FormatterName: LogDisable

Returns: Void
Description:

Disables the logger

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogEnable

Example: LogEnable()
FormatterName: LogEnable

Returns: Void
Description:

Enables the logger

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogError

Example: LogError(string eventId, string message)
FormatterName: LogError
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogInfo

Example: LogInfo(string eventId, string message)
FormatterName: LogInfo
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogTrace

Example: LogTrace(string eventId, string message)
FormatterName: LogTrace
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

LoggingFormatter.LogWarn

Example: LogWarn(string eventId, string message)
FormatterName: LogWarn
Arguments:

  • string: eventId
  • string: message

Returns: Void
Description:

Logs an Specific event

Must be first setup by setting the ParserOptions.Logger property

class LinqFormatter

LinqFormatter.Aggregate

Example: (IEnumerable<T>).Aggregate(string delimiter)
FormatterName: Aggregate
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: delimiter

Returns: string
Description:

Joins the element of a list separated by a delimiter string and return the concatenated string.

LinqFormatter.Any

Example: (IEnumerable<T>).Any()
FormatterName: Any
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: bool
Description:

returns if there are any elements in the collection

LinqFormatter.Compact

Example: (IEnumerable<T>).Compact()
FormatterName: Compact
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: IEnumerable<T>
Description:

Removes any non-null values from the input list.

LinqFormatter.Concat

Example: (IEnumerable<T>).Concat(IEnumerable<T> targetCollection)
FormatterName: Concat
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • IEnumerable<T>: targetCollection

Returns: IEnumerable
Description:

Concats two lists together

LinqFormatter.Contains

Example: (IEnumerable<T>).Contains(T arguments)
FormatterName: Contains
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • T: arguments

Returns: bool
Description:

Searches in the list for that the argument

LinqFormatter.Count

Example: (IEnumerable<T>).Count()
FormatterName: Count
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: int
Description:

Gets the count of the list

LinqFormatter.DefaultIfEmpty

Example: (IEnumerable<T>).DefaultIfEmpty(T defaultValue)
FormatterName: DefaultIfEmpty
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • T: defaultValue

Returns: IEnumerable<T>
Description:

If the source list is empty, the parameter will be returned instead

LinqFormatter.Distinct

Example: (IEnumerable<T>).Distinct()
FormatterName: Distinct
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: IEnumerable
Description:

Filters duplicates from the list

LinqFormatter.ElementAt

Example: (IEnumerable<T>).ElementAt(int index)
FormatterName: ElementAt
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • int: index

Returns: T
Description:

Gets the item in the list on the position

LinqFormatter.ElementAtOrDefault

Example: (IEnumerable<T>).ElementAtOrDefault(int index)
FormatterName: ElementAtOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • int: index

Returns: T
Description:

Gets the item in the list on the position

LinqFormatter.Except

Example: (IEnumerable<T>).Except(IEnumerable<T> targetCollection)
FormatterName: Except
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • IEnumerable<T>: targetCollection

Returns: IEnumerable
Description:

Gets all items from the source list except for all items in the target list

LinqFormatter.First

Example: (IEnumerable<T>).First()
FormatterName: First
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Selects the First item in the list

LinqFormatter.FirstOrDefault

Example: (IEnumerable<T>).FirstOrDefault()
FormatterName: FirstOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Gets the first item in the list that matches the predicate

LinqFormatter.GroupByList

Example: (IGrouping<TKey, T>).FlatGroup()
FormatterName: FlatGroup
Arguments:

  • [SourceObject] IGrouping<TKey, T>: sourceCollection

Returns: IEnumerable<T>
Description:

Flattens the Group returned by group by

LinqFormatter.Intersect

Example: (IEnumerable<T>).Intersect(IEnumerable<T> targetCollection)
FormatterName: Intersect
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • IEnumerable<T>: targetCollection

Returns: IEnumerable
Description:

Gets the list of all duplicates from both lists

LinqFormatter.Last

Example: (IEnumerable<T>).Last()
FormatterName: Last
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Selects the Last item in the list

LinqFormatter.LastOrDefault

Example: (IEnumerable<T>).LastOrDefault()
FormatterName: LastOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Gets the Last item in the list that matches the predicate

LinqFormatter.Max

Example: (IEnumerable<T>).Max()
FormatterName: Max
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Called on a list of numbers it returns the biggest

LinqFormatter.Min

Example: (IEnumerable<T>).Min()
FormatterName: Min
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Called on a list of numbers it returns the smallest

LinqFormatter.Partition

Example: (IEnumerable<T>).Partition(Number size)
FormatterName: Partition
Arguments:

  • [SourceObject] IEnumerable<T>: source
  • Number: size

Returns: IEnumerable<List<T>>
Description:

Splits the source into a list of lists equals the size of size

LinqFormatter.Range

Example: (int).Range(int count)
FormatterName: Range
Arguments:

  • [SourceObject] int: start
  • int: count

Returns: IEnumerable<int>
Description:

Generates a list of numbers

LinqFormatter.Repeat

Example: (T).Repeat(int count)
FormatterName: Repeat
Arguments:

  • [SourceObject] T: element
  • int: count

Returns: IEnumerable<T>
Description:

Creates a list of the given item

LinqFormatter.Reverse

Example: (IEnumerable<T>).Reverse()
FormatterName: Reverse
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: IEnumerable
Description:

Reverses the order of all items in the list

LinqFormatter.SequenceEqual

Example: (IEnumerable<T>).SequenceEqual(IEnumerable<T> targetCollection)
FormatterName: SequenceEqual
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • IEnumerable<T>: targetCollection

Returns: bool
Description:

Checks for all items of both lists for equality

LinqFormatter.Single

Example: (IEnumerable<T>).Single()
FormatterName: Single
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Selects the only item in the list

LinqFormatter.Skip

Example: (IEnumerable<T>).Skip(Number arguments)
FormatterName: Skip
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • Number: arguments

Returns: IEnumerable<T>
Description:

Skips the amount of items in argument

LinqFormatter.Take

Example: (IEnumerable<T>).Take(Number arguments)
FormatterName: Take
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • Number: arguments

Returns: IEnumerable<T>
Description:

Takes the amount of items in argument

LinqFormatter.Union

Example: (IEnumerable<T>).Union(IEnumerable<T> targetCollection)
FormatterName: Union
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • IEnumerable<T>: targetCollection

Returns: IEnumerable
Description:

Creates a new list that contains all unqiue items from both lists

class DynamicLinq

DynamicLinq.Aggregate

Example: (IEnumerable<T>).Aggregate(string function, string member)
FormatterName: Aggregate
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: function
  • string: member

Returns: object
Description:

Aggregate all items in the list

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.All

Example: (IEnumerable<T>).All(string predicate, object[] arguments)
FormatterName: All
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: bool
Description:

returns if All elements in the collection matches the condition

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Any

Example: (IEnumerable<T>).Any(string predicate, object[] arguments)
FormatterName: Any
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: bool
Description:

returns if Any elements in the collection matches the condition

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Any

Example: (IEnumerable).Any()
FormatterName: Any | any
Arguments:

  • [SourceObject] IEnumerable: sourceCollection

Returns: bool
Description:

Returns ether true or false if the expression in the argument is fulfilled by any item

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Average

Example: (IEnumerable<T>).Average(string predicate, object[] arguments)
FormatterName: Average
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: double
Description:

returns the Average of all items in the collection

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Cast

Example: (IEnumerable<T>).Cast(string type)
FormatterName: Cast
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: type

Returns: IQueryable
Description:

casts all elements in the collection into another type

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Count

Example: (IEnumerable<T>).Count(string predicate, object[] arguments)
FormatterName: Count
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: decimal
Description:

Counts all items that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.First

Example: (IEnumerable<T>).First(string predicate, object[] arguments)
FormatterName: First
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the first item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.FirstOrDefault

Example: (IEnumerable<T>).FirstOrDefault(string predicate, object[] arguments)
FormatterName: FirstOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the first item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.GroupBy

Example: (IEnumerable<T>).GroupBy(string predicate, object[] arguments)
FormatterName: GroupBy
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable
Description:

Groups a list

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.GroupJoin

Example: (IEnumerable).GroupJoin(IEnumerable targetCollection, string outerKeySelector, string innerKeySelector, string resultSelector, object[] arguments)
FormatterName: GroupJoin
Arguments:

  • [SourceObject] IEnumerable: sourceCollection
  • IEnumerable: targetCollection
  • string: outerKeySelector
  • string: innerKeySelector
  • string: resultSelector
  • [RestParameter] object[]: arguments

Returns: IEnumerable
Description:

Joins two collections together

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Join

Example: (IEnumerable).Join(IEnumerable targetCollection, string outerKeySelector, string innerKeySelector, string resultSelector, object[] arguments)
FormatterName: Join
Arguments:

  • [SourceObject] IEnumerable: sourceCollection
  • IEnumerable: targetCollection
  • string: outerKeySelector
  • string: innerKeySelector
  • string: resultSelector
  • [RestParameter] object[]: arguments

Returns: IEnumerable
Description:

Joins two collections together

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Last

Example: (IEnumerable<T>).Last(string predicate, object[] arguments)
FormatterName: Last
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the Last item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.LastOrDefault

Example: (IEnumerable<T>).LastOrDefault(string predicate, object[] arguments)
FormatterName: LastOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the Last item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.OrderBy

Example: (IEnumerable<T>).OrderBy(string predicate, object[] arguments)
FormatterName: OrderBy
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable<T>
Description:

Orders the list descending

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.OrderBy

Example: (IEnumerable<T>).OrderBy()
FormatterName: OrderBy
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: IEnumerable<T>
Description:

Orders the list descending

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Select

Example: (IEnumerable<T>).Select(string predicate, object[] arguments)
FormatterName: Select
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable
Description:

Selects items from the collection based on the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.SelectMany

Example: (IEnumerable<T>).SelectMany(string predicate, object[] arguments)
FormatterName: SelectMany
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable
Description:

Selects a list of items from the collection based on the predicate and flattens them

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Single

Example: (IEnumerable<T>).Single(string predicate, object[] arguments)
FormatterName: Single
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the only item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.SingleOrDefault

Example: (IEnumerable<T>).SingleOrDefault()
FormatterName: SingleOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Gets the only item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.SingleOrDefault

Example: (IEnumerable<T>).SingleOrDefault(string predicate, object[] arguments)
FormatterName: SingleOrDefault
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: T
Description:

Gets the only item in the list that matches the predicate

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.SkipWhile

Example: (IEnumerable<T>).SkipWhile(string predicate, object[] arguments)
FormatterName: SkipWhile
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable<T>
Description:

Skips items from the collection as long as the predicate is true

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Sum

Example: (IEnumerable<T>).sum()
FormatterName: sum | Sum
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection

Returns: T
Description:

Aggreates the property in the argument and returns it

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.TakeWhile

Example: (IEnumerable<T>).TakeWhile(string predicate, object[] arguments)
FormatterName: TakeWhile
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable<T>
Description:

Takes items from the collection as long as the predicate is true

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.ThenBy

Example: (IOrderedQueryable<T>).ThenBy(string predicate, object[] arguments)
FormatterName: ThenBy
Arguments:

  • [SourceObject] IOrderedQueryable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable<T>
Description:

Orders an list previusly ordered with 'OrderBy'

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

DynamicLinq.Where

Example: (IEnumerable<T>).Where(string predicate, object[] arguments)
FormatterName: Where
Arguments:

  • [SourceObject] IEnumerable<T>: sourceCollection
  • string: predicate
  • [RestParameter] object[]: arguments

Returns: IEnumerable<T>
Description:

Filteres the collection based on the predicate. Accepts any number of additonal arguments

Must be added via Nuget package 'Morestachio.Linq' and added via 'contextObject.Formatters.AddFromType(typeof(DynamicLinq))'

class RegexFormatter

RegexFormatter.IsMatch

Example: (Regex).IsMatch(string input)
FormatterName: IsMatch
Arguments:

  • [SourceObject] Regex: pattern
  • string: input

Returns: bool
Description:

Searches the input string for one or more occurrences of the text supplied in the given pattern.

RegexFormatter.Match

Example: (Regex).Match(string input)
FormatterName: Match
Arguments:

  • [SourceObject] Regex: pattern
  • string: input

Returns: Match
Description:

Matches a regular expression with a string and returns the precise result as a RegexMatch object.

RegexFormatter.Matches

Example: (Regex).Matches(string input)
FormatterName: Matches
Arguments:

  • [SourceObject] Regex: pattern
  • string: input

Returns: MatchCollection
Description:

Returns all the successful matches as if Match was called iteratively numerous times.

RegexFormatter.Matches

Example: (Match).Matches(string replacement)
FormatterName: Matches
Arguments:

  • [SourceObject] Match: match
  • string: replacement

Returns: string
Description:

Returns the expansion of the passed replacement pattern. For example, if the replacement pattern is ?$1$2?, Result returns the concatenation of Group(1).ToString() and Group(2).ToString().

RegexFormatter.Regex

Example: (string).Regex()
FormatterName: Regex
Arguments:

  • [SourceObject] string: pattern

Returns: Regex
Description:

Creates a new Regex with the given pattern

RegexFormatter.Regex

Example: Regex(string pattern)
FormatterName: Regex
Arguments:

  • string: pattern

Returns: Regex
Description:

Creates a new Regex with the given pattern

RegexFormatter.Replace

Example: (Regex).Replace(string input, string replacement)
FormatterName: Replace
Arguments:

  • [SourceObject] Regex: pattern
  • string: input
  • string: replacement

Returns: string
Description:

Replaces all occurrences of the previously defined pattern with the replacement pattern, starting at the first character in the input string.

RegexFormatter.Split

Example: (Regex).Split(string input)
FormatterName: Split
Arguments:

  • [SourceObject] Regex: pattern
  • string: input

Returns: string[]
Description:

Splits the input string at the position defined by a previous pattern.

class RandomFormatter

RandomFormatter.Random

Example: Random()
FormatterName: Random

Returns: int
Description:

Gets a non-negative random number

RandomFormatter.Random

Example: Random(int upperBounds)
FormatterName: Random
Arguments:

  • int: upperBounds

Returns: int
Description:

Gets a non-negative random number where the number is capped by upperBounds

RandomFormatter.Random

Example: Random(int upperBounds, int lowerBounds)
FormatterName: Random
Arguments:

  • int: upperBounds
  • int: lowerBounds

Returns: int
Description:

Gets a non-negative random number where the number is capped by upperBounds and lowerBounds

class HtmlFormatter

HtmlFormatter.HtmlDecode

Example: (string).HtmlDecode()
FormatterName: HtmlDecode
Arguments:

  • [SourceObject] string: text

Returns: string
Description:

Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.

HtmlFormatter.HtmlDecode

Example: HtmlDecode(string text)
FormatterName: HtmlDecode
Arguments:

  • string: text

Returns: string
Description:

Converts a string that has been HTML-encoded for HTTP transmission into a decoded string.

HtmlFormatter.HtmlEncode

Example: (string).HtmlEncode()
FormatterName: HtmlEncode
Arguments:

  • [SourceObject] string: text

Returns: string
Description:

Converts a string to an HTML-encoded string.

HtmlFormatter.HtmlEncode

Example: HtmlEncode(string text)
FormatterName: HtmlEncode
Arguments:

  • string: text

Returns: string
Description:

Converts a string to an HTML-encoded string.

HtmlFormatter.Strip

Example: (string).HtmlStrip()
FormatterName: HtmlStrip
Arguments:

  • [SourceObject] string: text

Returns: string
Description:

Removes any HTML tags from the input string

HtmlFormatter.Strip

Example: HtmlStrip(string text)
FormatterName: HtmlStrip
Arguments:

  • string: text

Returns: string
Description:

Removes any HTML tags from the input string

HtmlFormatter.UrlEncode

Example: (string).UrlEncode()
FormatterName: UrlEncode
Arguments:

  • [SourceObject] string: text

Returns: string
Description:

Converts a string to its escaped representation.

HtmlFormatter.UrlEncode

Example: UrlEncode(string text)
FormatterName: UrlEncode
Arguments:

  • string: text

Returns: string
Description:

Converts a string to its escaped representation.

HtmlFormatter.UrlEscape

Example: (string).UrlEscape()
FormatterName: UrlEscape
Arguments:

  • [SourceObject] string: text

Returns: string
Description:

Converts a URI string to its escaped representation.

HtmlFormatter.UrlEscape

Example: UrlEscape(string text)
FormatterName: UrlEscape
Arguments:

  • string: text

Returns: string
Description:

Converts a URI string to its escaped representation.

class EncodingConstant

EncodingConstant.GetEncoding

Example: (int).GetEncoding()
FormatterName: GetEncoding
Arguments:

  • [SourceObject] int: codePage

Returns: Encoding
Description:

Returns the encoding associated with the specified code page identifier

EncodingConstant.GetEncoding

Example: (string).GetEncoding()
FormatterName: GetEncoding
Arguments:

  • [SourceObject] string: name

Returns: Encoding
Description:

Returns the encoding associated with the specified code page name.

Clone this wiki locally