![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
public
class
Order : XPObject {
public Order() {}
public decimal UnitPrice;
public int Qty;
public decimal Discount;
[PersistentAlias( " UnitPrice*Qty*(1-Discount) " )]
public decimal ExtendedPrice {
get { return Convert.ToDecimal(EvaluateAlias( " ExtendedPrice " )); }
}
}
public Order() {}
public decimal UnitPrice;
public int Qty;
public decimal Discount;
[PersistentAlias( " UnitPrice*Qty*(1-Discount) " )]
public decimal ExtendedPrice {
get { return Convert.ToDecimal(EvaluateAlias( " ExtendedPrice " )); }
}
}
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
[PersistentAlias(
"
TaskWork[].Sum(HoursSpent)
"
)]
public float HoursSpent {
get { return ( float )(EvaluateAlias( " HoursSpent " ) ?? 0f); }
}
public float TotalHours {
get { return RemainingHours + HoursSpent; }
}
[Association, Aggregated]
public XPCollection < TaskWork > TaskWork {
get { return GetCollection < TaskWork > ( " TaskWork " ); }
}
public float HoursSpent {
get { return ( float )(EvaluateAlias( " HoursSpent " ) ?? 0f); }
}
public float TotalHours {
get { return RemainingHours + HoursSpent; }
}
[Association, Aggregated]
public XPCollection < TaskWork > TaskWork {
get { return GetCollection < TaskWork > ( " TaskWork " ); }
}