/// <summary> /// Resolves the dependencies by means of persisting all models that this model is referencing. /// </summary> protected override void ResolveGeneratedDependency() { base.ResolveGeneratedDependency(); if (_vatCode != null) { _vatCode.Save(); this.ModifiedData.Vatcd = _vatCode.Value1; } if (_regionCode != null) { _regionCode.Save(); this.ModifiedData.Region = _regionCode.Value1; } if (_event != null) { _event.Save(); this.ModifiedData.CourseId = _event.Id == null && this.ModifiedData.CourseId != null ? "" : _event.Id; } if (_session != null) { _session.Save(); this.ModifiedData.ActId = _session.Id == null && this.ModifiedData.ActId != null ? "" : _session.Id; } if (_eventProduct != null) { _eventProduct.Save(); this.ModifiedData.EpId = _eventProduct.Id; } }
/// <summary> /// Provides denormalisation of the activity data, prior to persistence. /// </summary> protected internal override void Denormalise() { base.Denormalise(); if (_mainSession != null && (_mainSession.IsModified || _mainSession.SessionXrefMaster.IsModified)) { _mainSession.Denormalise(); _mainSession.Save(); } }