DataValidation class

namespace: Serenity.Services   assemblySerenity.Net.Services

Contains validation related helper methods for service handlers

public static class DataValidation

Public Members

name description
static ArgumentNull(…) Returns an argument null error
static ArgumentOutOfRange(…) Returns an argument out of range error
static AutoTrim(…) Automatically trims a string field value based on its TrimToEmpty and Trim flags.
static EnsureUniversalTime(…) Converts the field value to universal time
static EntityNotFoundError(…) Returns an entity not found error
static EntityReadAccessError(…) Returns an entity read access error
static EntityWriteAccessError(…) Returns an entity write access error
static GetEntitySingular(…) Gets singular entity name for a table
static InvalidDateRangeError(…) Returns an invalid date range error
static InvalidIdError(…) Returns a Invalid ID error (2 methods)
static InvalidValueError(…) Returns an invalid value error (2 methods)
static ParentRecordDeleted(…) Returns a parent record deleted error
static ReadOnlyError(…) Returns a field is readonly error
static RecordNotActive(…) Returns a record not active error
static RelatedRecordExist(…) Returns a related record exist error
static RequiredError(…) Returns a required validation error (2 methods)
static UnexpectedError(…) Returns an unexpected error
static ValidateDateRange(…) Validates date range is valid, e.g. start date is before end date etc.
static ValidateEnum(…) Validates enum is within allowed values, e.g. one its members
static ValidateEnum<T>(…) Validates enum is within allowed values, e.g. one of its members (2 methods)
static ValidateRequired(…) Validates that the field does not contain a null value or an empty string. (2 methods)
static ValidateRequiredIfModified(…) Validates that field values does not contain a null or empty string if the field is assigned

See Also