Class FormulaDefaultValueOnNewAttribute
Indicates this property has a formula that when evaluated provides a default value that should be initialized whenever a new instance of this item is created
Inherited Members
Namespace: LemonEdge.API.Attributes
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class FormulaDefaultValueOnNewAttribute : DefaultValueOnNewAttribute
Constructors
FormulaDefaultValueOnNewAttribute(string)
Creates a new DefaultValueOnNewAttribute with the specified formula value
Declaration
public FormulaDefaultValueOnNewAttribute(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The default formula value to always evaluate and use |
Methods
GetDefaultValue(Type, string)
Declaration
public override object GetDefaultValue(Type entityType, string propNameToDefault)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | entityType | |
| string | propNameToDefault |
Returns
| Type | Description |
|---|---|
| object |
Overrides
UpdateNewItem(UserInfo, IReadOnlyCache, IEntityUpdater, object, string)
Given a new instance of this item this updates the specified property with the stored hard coded value or by evaluating the formula
Declaration
public override Task UpdateNewItem(UserInfo user, IReadOnlyCache cache, IEntityUpdater updater, object item, string propNameToDefault)
Parameters
| Type | Name | Description |
|---|---|---|
| UserInfo | user | The current user that created this new item |
| IReadOnlyCache | cache | |
| IEntityUpdater | updater | |
| object | item | The new item that has a default value to be evaluated and created |
| string | propNameToDefault | The property to be updated with the default value |
Returns
| Type | Description |
|---|---|
| Task | A task indicating completion of this operation. Can take time if the value is a formula that requires evaluation |