chore
parent
0b72527130
commit
a5997ef463
|
@ -346,20 +346,12 @@ namespace LeanCloud.Storage {
|
||||||
return (int)ret["count"];
|
return (int)ret["count"];
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<T> Get(string objectId) {
|
public Task<T> Get(string objectId) {
|
||||||
if (string.IsNullOrEmpty(objectId)) {
|
if (string.IsNullOrEmpty(objectId)) {
|
||||||
throw new ArgumentNullException(nameof(objectId));
|
throw new ArgumentNullException(nameof(objectId));
|
||||||
}
|
}
|
||||||
WhereEqualTo("objectId", objectId);
|
WhereEqualTo("objectId", objectId);
|
||||||
Limit(1);
|
return First();
|
||||||
ReadOnlyCollection<T> results = await Find();
|
|
||||||
if (results != null) {
|
|
||||||
if (results.Count == 0) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return results[0];
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<ReadOnlyCollection<T>> Find() {
|
public async Task<ReadOnlyCollection<T>> Find() {
|
||||||
|
|
Loading…
Reference in New Issue