Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

CreateInstanceAttribute(Type) Constructor

Initializes a new instance of the CreateInstanceAttribute and overrides the return type of the target method.

Namespace: DevExpress.ExpressApp.DC

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public CreateInstanceAttribute(
    Type instanceType
)

#Parameters

Name Type Description
instanceType Type

A Type object, specifying the type of Domain Component instances that will be created by the CreateInstanceAttribute‘s target method. This parameter value is assigned to the CreateInstanceAttribute.InstanceType property.

#Remarks

This constructor is used to override the type of Domain Component instances created by a method.

[DomainComponent]
public interface IPerson {
    IAddressable Address { get; set; }
    [CreateInstance(typeof(IAddressableExtended))]
    IAddressable CreateAddress();
}
See Also