
Custom Constructors Example
The following example uses the sample model Library.dsl, to define a custom constructor for a domain class called CirculationBook. To add custom constructors, you create a partial class, define one or more constructors in it, and then add the partial class to the project.
The CirculationBook domain class has the GeneratesDoubleDerived property set to true. Therefore, you must define custom constructors for both the CirculationBook class and the CirculationBookBase abstract base class.
using Microsoft.VisualStudio.Modeling;
namespace ExampleNamespace
{
public partial class CirculationBookBase
{
public CirculationBookBase(Partition partition, PropertyAssignment[] propertyAssignments) : base(partition, propertyAssignments)
{
}
}
public partial class CirculationBook
{
public CirculationBook(Partition partition, PropertyAssignment[] propertyAssignments) : base(partition, propertyAssignments)
{
}
}
}