Assign this attribute to a data type property to enforce a default value for the property on newly created instanced of your data type. You specify a serialized C1 Function - this C1 Function will be executed and the result will be written to this property.

Namespace: Composite.Data
Assembly: Composite (in Composite.dll) Version: 6.1.6325.31818


public sealed class FunctionBasedNewInstanceDefaultFieldValueAttribute : NewInstanceDefaultFieldValueAttribute
Visual Basic
Public NotInheritable Class FunctionBasedNewInstanceDefaultFieldValueAttribute _
	Inherits NewInstanceDefaultFieldValueAttribute
Visual C++
public ref class FunctionBasedNewInstanceDefaultFieldValueAttribute sealed : public NewInstanceDefaultFieldValueAttribute


This sample shows how to use the FunctionBasedNewInstanceDefaultFieldValue attribute. Here the current date and time is set on the Created property through the use of the C1 Function Composite.Utils.Date.Now.
// data interface attributes ...
interface IMyDataType : IData
    [FunctionBasedNewInstanceDefaultFieldValue(@"<f:function name='Composite.Utils.Date.Now' xmlns:f='' />")]
    DateTime Created { get; set; }

    // more data properties ...


Inheritance Hierarchy


See Also