Merge pull request #105 from onerain88/get-support-include

LCQuery#Get 支持 include
oneRain 2021-02-18 11:31:30 +08:00 committed by GitHub
commit 4d94bbcd32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -351,7 +351,14 @@ namespace LeanCloud.Storage {
throw new ArgumentNullException(nameof(objectId)); throw new ArgumentNullException(nameof(objectId));
} }
string path = $"classes/{ClassName}/{objectId}"; string path = $"classes/{ClassName}/{objectId}";
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path); Dictionary<string, object> queryParams = null;
string includes = Condition.BuildIncludes();
if (!string.IsNullOrEmpty(includes)) {
queryParams = new Dictionary<string, object> {
{ "include", includes }
};
}
Dictionary<string, object> response = await LCApplication.HttpClient.Get<Dictionary<string, object>>(path, queryParams: queryParams);
return DecodeLCObject(response); return DecodeLCObject(response);
} }