Skip to content

Commit

Permalink
Merge pull request #105 from onerain88/get-support-include
Browse files Browse the repository at this point in the history
LCQuery#Get 支持 include
  • Loading branch information
onerain88 authored Feb 18, 2021
2 parents 36ed298 + 547d01e commit 4d94bbc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Storage/Storage/LCQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,14 @@ public async Task<T> Get(string objectId) {
throw new ArgumentNullException(nameof(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);
}

Expand Down

0 comments on commit 4d94bbc

Please sign in to comment.