示例#1
0
        /// <summary>
        /// Called before the model is saved by the DbContext.
        /// </summary>
        public override void OnSave()
        {
            // Order regions
            Regions = Regions.OrderBy(r => r.Order).ToStateList();

            // Ensure region id
            foreach (var reg in Regions)
            {
                reg.Id = reg.Id == Guid.Empty ? Guid.NewGuid() : reg.Id;
            }
        }
示例#2
0
        /// <summary>
        /// Called before the model is saved by the DbContext.
        /// </summary>
        public override void OnSave()
        {
            // ensure to call the base class OnSave which will validate the model
            base.OnSave();

            // Order regions
            Regions = Regions.OrderBy(r => r.Order).ToStateList();

            // Ensure region id
            foreach (var reg in Regions)
            {
                reg.Id = reg.Id == Guid.Empty ? Guid.NewGuid() : reg.Id;
            }
        }
示例#3
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public PageType()
 {
     Properties = new StateList <PageTypeProperty>();
     Regions    = new StateList <PageTypeRegion>();
 }