InitialValueScriptAttribute Class

Defines an attribute that will define an initial value script for a modeled table field that will get evaluated and assigned in the target use environment, e.g., Javascript.

Definition

Namespace: Gemstone.ComponentModel.DataAnnotations
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
[AttributeUsageAttribute(AttributeTargets.Property)]
public sealed class InitialValueScriptAttribute : Attribute
Inheritance
Object    Attribute    InitialValueScriptAttribute

Remarks

Example to set initial value to 30 days from now using a Javascript expression: [InitialValueScript("(new Date()).addDays(30)")]

Note that the DefaultValueAttribute should be used to set any constant values for new modeled record instances and the gemstone.expressions.model.DefaultValueExpressionAttribute should be used for applying any needed server-side run-time expression defaults, either of these will get assigned when using the gemstone.data.model.TableOperations<T>.NewRecord function. The InitialValueScriptAttribute is used to initialize the property value using an expression that gets evaluated in the target environment.

Constructors

InitialValueScriptAttribute Creates a new InitialValueScriptAttribute/

Properties

InitialValueScript Gets the initial value expression for a modeled table field.
TypeIdWhen implemented in a derived class, gets a unique identifier for this Attribute.
(Inherited from Attribute)

Methods

EqualsReturns a value that indicates whether this instance is equal to a specified object.
(Inherited from Attribute)
GetHashCodeReturns the hash code for this instance.
(Inherited from Attribute)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IsDefaultAttributeWhen overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.
(Inherited from Attribute)
MatchWhen overridden in a derived class, returns a value that indicates whether this instance equals a specified object.
(Inherited from Attribute)
ToStringReturns a string that represents the current object.
(Inherited from Object)

Extension Methods

GetEnumValueOrDefault Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)
GetEnumValueOrDefaultT Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions)

See Also