Skip to content

TrimAttribute class

namespace: Serenity.Data.Mapping   assembly: Serenity.Net.Services

Trim expression attribute, which removes the spaces at the start, at the end, or both, of a string, like TRIM, LTRIM and RTRIM of SQL Server.

[AttributeUsage(AttributeTargets.Property, AllowMultiple = true)]
public class TrimAttribute : BaseExpressionAttribute
parameter description
expression An expression that returns a string.

Public Members

name description
TrimAttribute(…) Trim expression attribute, which removes the spaces at the start, at the end, or both, of a string, like TRIM, LTRIM and RTRIM of SQL Server.
Expression { get; } String expression.
Leading { get; set; } Whether to remove the spaces at the start, true by default.
Trailing { get; set; } Whether to remove the spaces at the end, true by default.
override Translate(…)

Exceptions

exception condition
ArgumentNullException The expression is null.

See Also