diff --git a/Storage/Storage/Internal/Object/Controller/AVObjectController.cs b/Storage/Storage/Internal/Object/Controller/AVObjectController.cs index e9a750f..865b2f3 100644 --- a/Storage/Storage/Internal/Object/Controller/AVObjectController.cs +++ b/Storage/Storage/Internal/Object/Controller/AVObjectController.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -using LeanCloud.Utilities; using System.Net.Http; namespace LeanCloud.Storage.Internal { diff --git a/Storage/Storage/Public/AVObject.cs b/Storage/Storage/Public/AVObject.cs index b695f92..6c688de 100644 --- a/Storage/Storage/Public/AVObject.cs +++ b/Storage/Storage/Public/AVObject.cs @@ -455,11 +455,8 @@ string propertyName itemsToVisit = dict.Values; } else if (root is IList list) { itemsToVisit = list; - } else if (traverseAVObjects) { - var obj = root as AVObject; - if (obj != null) { - itemsToVisit = obj.Keys.ToList().Select(k => obj[k]); - } + } else if (traverseAVObjects && root is AVObject obj) { + itemsToVisit = obj.Keys.ToList().Select(k => obj[k]); } if (itemsToVisit != null) { foreach (var i in itemsToVisit) { @@ -591,11 +588,11 @@ string propertyName var uniqueObjects = new HashSet(objects, new IdentityEqualityComparer()); // 先保存文件对象(后面可以考虑将 AVFile 作为 AVObject 的子类型进行保存) - var saveDirtyFileTasks = DeepTraversal(obj, true) - .OfType() - .Where(f => f.IsDirty) - .Select(f => f.SaveAsync(cancellationToken: cancellationToken)).ToList(); - await Task.WhenAll(saveDirtyFileTasks); + //var saveDirtyFileTasks = DeepTraversal(obj, true) + // .OfType() + // .Where(f => f.IsDirty) + // .Select(f => f.SaveAsync(cancellationToken: cancellationToken)).ToList(); + //await Task.WhenAll(saveDirtyFileTasks); IEnumerable remaining = new List(uniqueObjects); while (remaining.Any()) {