public void RemoveFlowById(long flowId) { var flow = _dbContext.KnowledgeMaps.FirstOrDefault(f => f.Id == flowId); if (flow != null) { var steps = _dbContext.Steps.Where(s => s.MapId == flowId); if (steps != null) { _dbContext.Steps.RemoveRange(steps); } // flow.IsDeleted = true; _dbContext.KnowledgeMaps.Remove(flow); _dbContext.SaveChanges(); } }
public bool SaveChanges() { return(_dbContext.SaveChanges() > 0); }