/// <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; } }
/// <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; } }
/// <summary> /// Default constructor. /// </summary> public PageType() { Properties = new StateList <PageTypeProperty>(); Regions = new StateList <PageTypeRegion>(); }