/// <summary> /// Deletes any connection request workflows tied to this workflow. /// </summary> private void DeleteConnectionRequestWorkflows() { var connectionRequestWorkflowService = new ConnectionRequestWorkflowService(RockContext); var connectionRequestWorkflows = connectionRequestWorkflowService.Queryable().Where(c => c.WorkflowId == this.Entity.Id); if (connectionRequestWorkflows.Any()) { RockContext.BulkDelete(connectionRequestWorkflows); } }
/// <summary> /// Deletes any connection request workflows tied to this connection workflow. /// </summary> /// <param name="dbContext">The database context.</param> private void DeleteConnectionRequestWorkflows(Data.DbContext dbContext) { var rockContext = ( RockContext )dbContext; var connectionRequestWorkflowService = new ConnectionRequestWorkflowService(rockContext); var connectionRequestWorkflows = connectionRequestWorkflowService.Queryable().Where(c => c.ConnectionWorkflowId == this.Id); if (connectionRequestWorkflows.Any()) { dbContext.BulkDelete(connectionRequestWorkflows); } }