Defining Calculated Properties

The value of a calculated property is determined by a method that you provide.

Calculated Property Example

The following example references a real-world domain mode, Library.dsl, to define a calculated property called [AmountOwed]. To define this calculated property, 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;
        }
    }
}

See Also

Concepts

Overview of Library.dsl