FormatStringExtensionsFormatString Method |
Converts the object to string based on the format specified.
Namespace:
Aloe.SystemFrameworks.Domain
Assembly:
Aloe.SystemFrameworks.Domain (in Aloe.SystemFrameworks.Domain.dll) Version: 20.1.3.5
Syntaxpublic static string FormatString(
this DomainObject obj,
string format,
IFormatProvider formatProvider = null
)
<ExtensionAttribute>
Public Shared Function FormatString (
obj As DomainObject,
format As String,
Optional formatProvider As IFormatProvider = Nothing
) As String
public:
[ExtensionAttribute]
static String^ FormatString(
DomainObject^ obj,
String^ format,
IFormatProvider^ formatProvider = nullptr
)
[<ExtensionAttribute>]
static member FormatString :
obj : DomainObject *
format : string *
?formatProvider : IFormatProvider
(* Defaults:
let _formatProvider = defaultArg formatProvider null
*)
-> string
Parameters
- obj
- Type: Aloe.SystemFrameworks.DomainDomainObject
An object. - format
- Type: SystemString
a format. - formatProvider (Optional)
- Type: SystemIFormatProvider
The format provider.
Return Value
Type:
StringThe replaced string.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
DomainObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Remarks
The FormatString method supports:
1. Attributes: {DocumentDate}.
2. References: {Customer}.
3. Reference path: {Customer.Party.PartyName:C}.
ChildCollections are not supported.
The attribute values can be formatted with standard .Net format specifiers: {DocumentDate:yyyyMMdd}.
Also the format specifiers for objects like MultilanguageString, Quantity, Amount etc. are supported.
See Also