diff --git a/Demos/FeatureCenter/FeatureCenter.Module/RuntimeFields/CalculatedWithCode/CreateRuntimeCalculatedFieldController.cs b/Demos/FeatureCenter/FeatureCenter.Module/RuntimeFields/CalculatedWithCode/CreateRuntimeCalculatedFieldController.cs index f46313abea..79c4ca4b56 100644 --- a/Demos/FeatureCenter/FeatureCenter.Module/RuntimeFields/CalculatedWithCode/CreateRuntimeCalculatedFieldController.cs +++ b/Demos/FeatureCenter/FeatureCenter.Module/RuntimeFields/CalculatedWithCode/CreateRuntimeCalculatedFieldController.cs @@ -1,7 +1,6 @@ using System; using DevExpress.ExpressApp; using DevExpress.Persistent.Base; -using DevExpress.Xpo; using Xpand.ExpressApp; using Xpand.Xpo; @@ -10,11 +9,15 @@ public class CreateRuntimeCalculatedFieldController : ViewController { public override void CustomizeTypesInfo(DevExpress.ExpressApp.DC.ITypesInfo typesInfo) { base.CustomizeTypesInfo(typesInfo); var classInfo = XpandModuleBase.Dictiorary.GetClassInfo(typeof(Customer)); - - if (classInfo.FindMember("SumOfOrderTotals")==null) { + + if (classInfo.FindMember("SumOfOrderTotals") == null) { + var xpandCalcMemberInfo = classInfo.CreateCalculabeMember("SumOfOrderTotals", typeof(float), "Orders.Sum(Total)"); var attributes = new Attribute[] {new VisibleInListViewAttribute(false),new VisibleInLookupListViewAttribute(false), - new VisibleInDetailViewAttribute(false),new PersistentAliasAttribute("Orders.Sum(Total)")}; - classInfo.CreateCalculabeMember("SumOfOrderTotals", typeof(float), attributes); + new VisibleInDetailViewAttribute(false)}; + foreach (var attribute in attributes) { + xpandCalcMemberInfo.AddAttribute(attribute); + } + typesInfo.RefreshInfo(typeof(Customer)); } }