Class Extensions
Useful extension methods
Inheritance
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public static class Extensions
Methods
| Improve this Doc View SourceAsBytes(Stream)
Render a System.IO.Stream to a System.Byte array
Declaration
public static byte[] AsBytes(this Stream data)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | data | System.IO.Stream to render |
Returns
Type | Description |
---|---|
System.Byte[] | A System.Byte array representing the contents of |
AsString(IHttpResponse)
Returns a string from the HTTP response
Declaration
public static string AsString(this IHttpResponse resp)
Parameters
Type | Name | Description |
---|---|---|
IHttpResponse | resp | The HTTP response. |
Returns
Type | Description |
---|---|
System.String | A string from the HTTP response |
AsString(Stream)
Render a System.IO.Stream to a System.String
Declaration
public static string AsString(this Stream data)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | data | System.IO.Stream to render |
Returns
Type | Description |
---|---|
System.String | A System.String representing the contents of |
AsXml(IHttpResponse)
Creates an System.Xml.Linq.XElement from the data returned by the IHttpResponse
Declaration
public static XElement AsXml(this IHttpResponse resp)
Parameters
Type | Name | Description |
---|---|---|
IHttpResponse | resp | IHttpResponse returned by the server |
Returns
Type | Description |
---|---|
System.Xml.Linq.XElement | An System.Xml.Linq.XElement representing the XML from the response |
GroupConcat<T>(IEnumerable<T>, String, Func<T, String>)
Concatenate the string representation of a set of values to a single string separated by separator
Declaration
public static string GroupConcat<T>(this IEnumerable<T> values, string separator, Func<T, string> renderer = null)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | values | Values to concatenate |
System.String | separator | System.String to use as a separator |
System.Func<T, System.String> | renderer | Function used to render a value as a string. If not specified, System.Object.ToString() is used |
Returns
Type | Description |
---|---|
System.String | A single string containing the string representation of each value in |
Type Parameters
Name | Description |
---|---|
T |
Remarks
This performs a similar function to System.String.Join(System.String,System.Collections.Generic.IEnumerable{System.String}) which is available in .Net 4+
IsNullOrEmpty(SecureToken)
Indicates if a SecureToken is null or empty
Declaration
public static bool IsNullOrEmpty(this SecureToken token)
Parameters
Type | Name | Description |
---|---|---|
SecureToken | token | The token to check. |
Returns
Type | Description |
---|---|
System.Boolean |
|
ToArasId(Guid)
Renders a System.Guid using the default Aras ID format.
Declaration
public static string ToArasId(this Guid guid)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | guid | System.Guid to render as an ID |
Returns
Type | Description |
---|---|
System.String | 32-character System.String representing the ID |
ToArasId(Nullable<Guid>)
Renders a System.Nullable<T> using the default Aras ID format.
Declaration
public static string ToArasId(this Guid? guid)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.Guid> | guid | System.Nullable<T> to render as an ID |
Returns
Type | Description |
---|---|
System.String |
|