From a5997ef4636c583f7d2ef3fb135339341ed4ef0b Mon Sep 17 00:00:00 2001 From: oneRain Date: Mon, 21 Dec 2020 14:45:40 +0800 Subject: [PATCH] chore --- Storage/Storage/LCQuery.cs | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/Storage/Storage/LCQuery.cs b/Storage/Storage/LCQuery.cs index 799b354..928bc1e 100644 --- a/Storage/Storage/LCQuery.cs +++ b/Storage/Storage/LCQuery.cs @@ -346,20 +346,12 @@ namespace LeanCloud.Storage { return (int)ret["count"]; } - public async Task Get(string objectId) { + public Task Get(string objectId) { if (string.IsNullOrEmpty(objectId)) { throw new ArgumentNullException(nameof(objectId)); } WhereEqualTo("objectId", objectId); - Limit(1); - ReadOnlyCollection results = await Find(); - if (results != null) { - if (results.Count == 0) { - return null; - } - return results[0]; - } - return null; + return First(); } public async Task> Find() {