/// <summary> /// Called after deploying an application. /// </summary> /// <param name="entities">The entities.</param> /// <param name="state">The state.</param> public void OnAfterDeploy(IEnumerable <IEntity> entities, IDictionary <string, object> state) { var enumerable = entities as IList <IEntity> ?? entities.ToList(); var solutions = enumerable.Select(e => e.As <Solution>()).Where(s => s != null); foreach (var sol in solutions) { EventLog.Application.WriteInformation("Deployed application '{0}'.", sol.Name); _auditLogEventTarget.AuditLog.OnDeployApplication(true, sol.Name, sol.SolutionVersionString); } RemoveDanglingEntities(); UpgradeTopMenuNavSections(); FixNavigationSections(); UpgradeSolutionData(solutions); AutoNumber.Upgrade(solutions); SendEmailWorkflowActivity.Upgrade(solutions); InvalidateBulkRequestCache(); InvalidateMetadataCaches(); // we need to do this explicitly as the app import will not necessarily fire the normal event targets. }
/// <summary> /// Called after saving of the specified enumeration of entities has taken place. /// </summary> /// <param name="entities">The entities.</param> /// <param name="state">The state passed between the before upgrade and after upgrade call backs.</param> public void OnAfterUpgrade(IEnumerable <IEntity> entities, IDictionary <string, object> state) { var enumerable = entities as IList <IEntity> ?? entities.ToList(); var solutions = enumerable.Select(e => e.As <Solution>()).Where(s => s != null); AutoNumber.Upgrade(solutions); SendEmailWorkflowActivity.Upgrade(solutions); FixNavigationSections(); InvalidateBulkRequestCache(); InvalidateMetadataCaches(); }