fix: LCQuery.Get() support include

oneRain 2021-02-18 11:20:29 +08:00
parent 36ed2980fb
commit 547d01e179
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);
} }