コード例 #1
0
ファイル: LiteDatabase.cs プロジェクト: heliomarpm/LiteDB
        /// <summary>
        /// Rename a collection. Returns false if oldName does not exists or newName already exists
        /// </summary>
        public bool RenameCollection(string oldName, string newName)
        {
            if (oldName.IsNullOrWhiteSpace())
            {
                throw new ArgumentNullException(nameof(oldName));
            }
            if (newName.IsNullOrWhiteSpace())
            {
                throw new ArgumentNullException(nameof(newName));
            }

            return(_engine.RenameCollection(oldName, newName));
        }
コード例 #2
0
 public bool RenameCollection(string name, string newName)
 {
     try
     {
         NotificationService.Cache.AddBroadcast(name);
         NotificationService.Cache.AddBroadcast(newName);
         var result = _engine.RenameCollection(name, newName);
         NotificationService.Notify();
         return(result);
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         NotificationService.Clear();
     }
 }