Class HardCodedDefaultValueOnNewAttribute
Indicates this property has a hard coded default value that should be initialized whenever a new instance of this item is created
Inheritance
HardCodedDefaultValueOnNewAttribute
Inherited Members
Namespace: LemonEdge.API.Attributes
Assembly: LemonEdge.API.dll
Syntax
[AttributeUsage(AttributeTargets.Property)]
public class HardCodedDefaultValueOnNewAttribute : DefaultValueOnNewAttribute
Constructors
HardCodedDefaultValueOnNewAttribute(string)
Creates a new DefaultValueOnNewAttribute with the specified hardcoded value
Declaration
public HardCodedDefaultValueOnNewAttribute(string value)
Parameters
Type | Name | Description |
---|---|---|
string | value | The default hardcoded value to always 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 |