/// <summary> /// Adds the changes. /// </summary> /// <param name="rockContext">The rock context.</param> /// <param name="modelType">Type of the model.</param> /// <param name="categoryGuid">The category unique identifier.</param> /// <param name="entityId">The entity identifier.</param> /// <param name="changes">The changes.</param> /// <param name="caption">The caption.</param> /// <param name="relatedModelType">Type of the related model.</param> /// <param name="relatedEntityId">The related entity identifier.</param> /// <param name="modifiedByPersonAliasId">The modified by person alias identifier.</param> public static void AddChanges(RockContext rockContext, Type modelType, Guid categoryGuid, int entityId, History.HistoryChangeList changes, string caption, Type relatedModelType, int?relatedEntityId, int?modifiedByPersonAliasId = null) { List <History> historyRecordsToInsert = GetChanges(modelType, categoryGuid, entityId, changes, caption, relatedModelType, relatedEntityId, modifiedByPersonAliasId); var historyService = new HistoryService(rockContext); historyService.AddRange(historyRecordsToInsert); }