[AttributeUsageAttribute(AttributeTargets.Property)]
public sealed class InitialValueScriptAttribute : Attribute<AttributeUsageAttribute(AttributeTargets.Property)>
Public NotInheritable Class InitialValueScriptAttribute
Inherits Attribute[AttributeUsageAttribute(AttributeTargets::Property)]
public ref class InitialValueScriptAttribute sealed : public AttributeGemstone.ComponentModel.DataAnnotations.InitialValueScriptAttribute = function();
Type.createClass(
'Gemstone.ComponentModel.DataAnnotations.InitialValueScriptAttribute',
Attribute);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.
| InitialValueScriptAttribute | Creates a new InitialValueScriptAttribute/ |
| InitialValueScript | Gets the initial value expression for a modeled table field. |
| TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute) |
| Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute) |
| GetHashCode | Returns the hash code for this instance. (Inherited from Attribute) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute) |
| Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| 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) |