This interface is used togehter with the attribute BuildNewHandlerAttribute. It is possible to overwrite the default behavior when a new data item is created through the method New<(Of <<'(TData>)>>)()()()() To do this, you have to implement this interface and attach it to your IData type by using the attribute BuildNewHandlerAttribute


interface IMyDataType : IData
    Guid Id { get; set; }

    [StoreFieldType(PhysicalStoreFieldType.String, 256)]
    string Name { get; set; }

class MyBuildNewHandler : IBuildNewHandler
    public Type GetTypeToBuild(Type dataType)
        /* dataType will always be typeof(IMyDataType) */

        return typeof(MyDataType);

class MyDataType : IMyDataType
    puglic MyDataType()
        /* All new instances of IMyDataType will becrated through this constructor */
        this.Id = Guid.NewGuid();
        this.Name = "RandomName";

    public Id { get; set; }

    public Name { get; set; }

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


public interface IBuildNewHandler
Visual Basic
Public Interface IBuildNewHandler
Visual C++
public interface class IBuildNewHandler

See Also