Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The value of a calculated property is determined by a method that you provide.
Calculated Property Example
The following example uses the sample model Library.dsl to define a calculated property called AmountOwed. You set the Kind property on a domain property to Calculated. Next, you add the partial class LibraryHasMembers to the project. You then provide the method GetAmountOwedValue, which determines the total amount that a member owes for overdue and lost books.
namespace ExampleNamespace
{
public partial class LibraryHasMembers
{
private System.Single GetAmountOwedValue()
{
// Do calculation to get amount owed.
return 0.0F;
}
}
}