/// <summary> /// 删除分区策略 /// </summary> /// <param name="id">分区策略ID</param> public void DeleteShardingStrategy(string id) { var strategy = ShardingStrategies.FirstOrDefault(i => i.ID == id); if (strategy != null) { ShardingStrategies.Remove(strategy); } this.SaveChanges(); }
/// <summary> /// 获取分区策略 /// </summary> /// <param name="id">分区策略ID</param> /// <returns>分区策略</returns> public ShardingStrategy GetShardingStrategy(string id) { return(ShardingStrategies.FirstOrDefault(i => i.ID == id)); }