Try our conversational search powered by Generative AI!

Class Converter

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Helper functions for common converter scenarios

Inheritance
System.Object
Converter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public class Converter

Constructors

Converter()

Declaration
public Converter()

Methods

ToIntZero(Object)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Returns 0 if parameter is anything else than of type System.Int32, also supports converting of False to 0 and True to 1.

Declaration
public static int ToIntZero(object val)
Parameters
Type Name Description
System.Object val
Returns
Type Description
System.Int32

ToStringEmpty(Object)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Returns String.Empty if parameter is anything else than of type System.String.

Declaration
public static string ToStringEmpty(object val)
Parameters
Type Name Description
System.Object val
Returns
Type Description
System.String

ToStringNull(Object)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Tries to cast to a string.

Declaration
public static string ToStringNull(object val)
Parameters
Type Name Description
System.Object val

The object to cast.

Returns
Type Description
System.String

val cast to a string if it is a string, otherwise null.

ToSystemNull(Object)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Converts from System.DBNull to null.

Declaration
public static object ToSystemNull(object val)
Parameters
Type Name Description
System.Object val

The object to convert.

Returns
Type Description
System.Object

null if val is System.DBNull, otherwise val unchanged.

Extension Methods