Sana Assistant (online)
Table of Contents

ErpFieldValue Class

The ErpFieldValue class represents a field value which can be used in ERP. It provides methods to convert values to various types and static factory methods to create instances from different data types.

ErpFieldValue class

Methods

AsBoolean

public bool? AsBoolean()

Converts field value to bool type. Returns the converted value or null in case value cannot be converted.

AsDate

public DateOnly? AsDate()

Converts field value to DateOnly type. Returns the converted value or null in case value cannot be converted.

AsDateTime

public DateTime? AsDateTime()

Converts field value to DateTime type. Returns the converted value or null in case value cannot be converted.

AsDecimal

public decimal? AsDecimal()

Converts field value to decimal type. Returns the converted value or null in case value cannot be converted.

AsGuid

public Guid? AsGuid()

Converts field value to Guid type. Returns the converted value or null in case value cannot be converted.

AsInt

public int? AsInt()

Converts field value to int type. Returns the converted value or null in case value cannot be converted.

AsLong

public long? AsLong()

Converts field value to long type. Returns the converted value or null in case value cannot be converted.

AsObject

public object AsObject()

Converts field value to object type. Returns the underlying value as an object.

AsString

public string? AsString()

Converts field value to string type. Returns the converted value or null in case value cannot be converted.

FromBoolean

public static ErpFieldValue FromBoolean(bool value)

Creates ErpFieldValue based on value of bool type.

Parameters

  • value: The boolean value to wrap.

Returns

The instance of ErpFieldValue.

FromDate

public static ErpFieldValue FromDate(DateOnly value)

Creates ErpFieldValue based on value of DateOnly type.

Parameters

  • value: The date value to wrap.

Returns

The instance of ErpFieldValue.

FromDateTime

public static ErpFieldValue FromDateTime(DateTime value)

Creates ErpFieldValue based on value of DateTime type.

Parameters

  • value: The date-time value to wrap.

Returns

The instance of ErpFieldValue.

FromDecimal

public static ErpFieldValue FromDecimal(decimal value)

Creates ErpFieldValue based on value of decimal type.

Parameters

  • value: The decimal value to wrap.

Returns

The instance of ErpFieldValue.

FromGuid

public static ErpFieldValue FromGuid(Guid value)

Creates ErpFieldValue based on value of Guid type.

Parameters

  • value: The GUID value to wrap.

Returns

The instance of ErpFieldValue.

FromInt

public static ErpFieldValue FromInt(int value)

Creates ErpFieldValue based on value of int type.

Parameters

  • value: The integer value to wrap.

Returns

The instance of ErpFieldValue.

FromLong

public static ErpFieldValue FromLong(long value)

Creates ErpFieldValue based on value of long type.

Parameters

  • value: The long integer value to wrap.

Returns

The instance of ErpFieldValue.

FromString

public static ErpFieldValue FromString(string value)

Creates ErpFieldValue based on value of string type.

Parameters

  • value: The string value to wrap.

Returns

The instance of ErpFieldValue.

See Also