Search Results for

    Show / Hide Table of Contents

    Class DefaultValueOnNewAttribute

    Indicates this property has a default value that should be initialized whenever a new instance of this item is created

    This can be a hard coded value, or a formula that is evaluated at run time

    Inheritance
    object
    Attribute
    DefaultValueOnNewAttribute
    FormulaDefaultValueOnNewAttribute
    HardCodedDefaultValueOnNewAttribute
    Inherited Members
    Attribute.GetCustomAttributes(MemberInfo, Type)
    Attribute.GetCustomAttributes(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(MemberInfo)
    Attribute.GetCustomAttributes(MemberInfo, bool)
    Attribute.IsDefined(MemberInfo, Type)
    Attribute.IsDefined(MemberInfo, Type, bool)
    Attribute.GetCustomAttribute(MemberInfo, Type)
    Attribute.GetCustomAttribute(MemberInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo)
    Attribute.GetCustomAttributes(ParameterInfo, Type)
    Attribute.GetCustomAttributes(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(ParameterInfo, bool)
    Attribute.IsDefined(ParameterInfo, Type)
    Attribute.IsDefined(ParameterInfo, Type, bool)
    Attribute.GetCustomAttribute(ParameterInfo, Type)
    Attribute.GetCustomAttribute(ParameterInfo, Type, bool)
    Attribute.GetCustomAttributes(Module, Type)
    Attribute.GetCustomAttributes(Module)
    Attribute.GetCustomAttributes(Module, bool)
    Attribute.GetCustomAttributes(Module, Type, bool)
    Attribute.IsDefined(Module, Type)
    Attribute.IsDefined(Module, Type, bool)
    Attribute.GetCustomAttribute(Module, Type)
    Attribute.GetCustomAttribute(Module, Type, bool)
    Attribute.GetCustomAttributes(Assembly, Type)
    Attribute.GetCustomAttributes(Assembly, Type, bool)
    Attribute.GetCustomAttributes(Assembly)
    Attribute.GetCustomAttributes(Assembly, bool)
    Attribute.IsDefined(Assembly, Type)
    Attribute.IsDefined(Assembly, Type, bool)
    Attribute.GetCustomAttribute(Assembly, Type)
    Attribute.GetCustomAttribute(Assembly, Type, bool)
    Attribute.Equals(object)
    Attribute.GetHashCode()
    Attribute.Match(object)
    Attribute.IsDefaultAttribute()
    Attribute.TypeId
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    Namespace: LemonEdge.API.Attributes
    Assembly: LemonEdge.API.dll
    Syntax
    public abstract class DefaultValueOnNewAttribute : Attribute

    Constructors

    DefaultValueOnNewAttribute()

    Declaration
    protected DefaultValueOnNewAttribute()

    Fields

    _defaultValue

    Declaration
    protected string _defaultValue
    Field Value
    Type Description
    string

    Methods

    GetDefaultValue(Type, string)

    Declaration
    public abstract object GetDefaultValue(Type entityType, string propNameToDefault)
    Parameters
    Type Name Description
    Type entityType
    string propNameToDefault
    Returns
    Type Description
    object

    SetValue(string)

    Indicates this property should always have the specified value when a new Entity is created

    Declaration
    public void SetValue(string value)
    Parameters
    Type Name Description
    string value

    The hardcoded value, or formula to evaluate dynamically, to provide as default when creating a new Entity

    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 abstract 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

    UpdateNewValue(object, object, string)

    Declaration
    protected void UpdateNewValue(object newValue, object item, string propNameToDefault)
    Parameters
    Type Name Description
    object newValue
    object item
    string propNameToDefault

    Extension Methods

    LinqExtensions.AsArray<T>(T)
    LinqExtensions.ToArrayOfOne<T>(T)
    LinqExtensions.ToListOfOne<T>(T)
    MiscExtensions.SetIfNotEqual<T, TP>(T, Expression<Func<T, TP>>, TP)
    WeakReferenceExtensions.WeakReference(object)
    SQLExtensions.ToSQLValue(object, bool)
    ReflectionExtensions.ClearEventInvocations(object, string)
    StringExtensions.ToCSVFormatString(object, Type)
    In this article
    Back to top © LemonEdge Technologies. All rights reserved.