public void AddCollection(string name, CollectionConfiguration collection)
 {
     lock (_collectionConfs)
     {
         _collectionConfs.Add(name, collection);
     }
 }
 public void AddCollection(CollectionConfiguration collection)
 {
     lock (_collectionConfs)
     {
         _collectionConfs.Add(collection.CollectionName, collection);
     }
 }
 public bool CreateCollection(string cluster, string shard, string database, CollectionConfiguration configuration, IDistributionStrategy distribution)
 {
     try
     {
         return(this.dbMgtServer.CreateCollection(cluster, shard, database, configuration, distribution));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public static void ValidateConfiguration(CollectionConfigurations configuraiton)
        {
            if (configuraiton == null)
            {
                throw new Exception("Collection Configuration cannot be null.");
            }
            foreach (var pair in configuraiton.Configuration)
            {
                if (pair.Key == null)
                {
                    throw new Exception("Collection Name cannot be null.");
                }
                if (pair.Key.Trim() == "")
                {
                    throw new Exception("Collection Name cannot be empty string.");
                }

                CollectionConfiguration.ValidateConfiguration(pair.Value);
            }
        }