public static void DeleteChanges( RockContext rockContext, Type modelType, int entityId )
{
var entityType = EntityTypeCache.Read( modelType );
if ( entityType != null )
{
var historyService = new HistoryService( rockContext );
foreach( var history in historyService.Queryable()
.Where( h =>
h.EntityTypeId == entityType.Id &&
h.EntityId == entityId ) )
{
historyService.Delete( history );
}
rockContext.SaveChanges();
}
}