コード例 #1
0
        /// <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();
        }
コード例 #2
0
 /// <summary>
 /// 获取分区策略
 /// </summary>
 /// <param name="id">分区策略ID</param>
 /// <returns>分区策略</returns>
 public ShardingStrategy GetShardingStrategy(string id)
 {
     return(ShardingStrategies.FirstOrDefault(i => i.ID == id));
 }