代码
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")); }
   }
}

 

代码
        [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"); }
        }

 

 

相关文章:

  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
猜你喜欢
  • 2022-12-23
  • 2021-04-30
  • 2021-09-07
  • 2021-08-16
  • 2021-10-18
  • 2022-12-23
相关资源
相似解决方案