chore: 避免强转空指针
parent
5609509e34
commit
66e07a2041
|
@ -1,5 +1,6 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
using LeanCloud;
|
using LeanCloud;
|
||||||
using LeanCloud.Storage;
|
using LeanCloud.Storage;
|
||||||
|
|
||||||
|
@ -74,5 +75,16 @@ namespace Storage.Test {
|
||||||
TestContext.WriteLine(account.ObjectId);
|
TestContext.WriteLine(account.ObjectId);
|
||||||
Assert.NotNull(account.ObjectId);
|
Assert.NotNull(account.ObjectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Serialization() {
|
||||||
|
LCQuery<LCObject> query = new LCQuery<LCObject>("Account") {
|
||||||
|
IncludeACL = true
|
||||||
|
};
|
||||||
|
ReadOnlyCollection<LCObject> accounts = await query.Find();
|
||||||
|
foreach (LCObject account in accounts) {
|
||||||
|
TestContext.WriteLine(account);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,10 @@ namespace LeanCloud.Storage.Internal.Query {
|
||||||
get; set;
|
get; set;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IncludeACL {
|
||||||
|
get; set;
|
||||||
|
}
|
||||||
|
|
||||||
public LCCompositionalCondition(string composition = And) {
|
public LCCompositionalCondition(string composition = And) {
|
||||||
this.composition = composition;
|
this.composition = composition;
|
||||||
Skip = 0;
|
Skip = 0;
|
||||||
|
@ -217,6 +221,9 @@ namespace LeanCloud.Storage.Internal.Query {
|
||||||
if (selectedKeys != null && selectedKeys.Count > 0) {
|
if (selectedKeys != null && selectedKeys.Count > 0) {
|
||||||
dict["keys"] = string.Join(",", selectedKeys);
|
dict["keys"] = string.Join(",", selectedKeys);
|
||||||
}
|
}
|
||||||
|
if (IncludeACL) {
|
||||||
|
dict["returnACL"] = "true";
|
||||||
|
}
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,6 +333,17 @@ namespace LeanCloud.Storage {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否包含 ACL
|
||||||
|
/// </summary>
|
||||||
|
public bool IncludeACL {
|
||||||
|
get {
|
||||||
|
return Condition.IncludeACL;
|
||||||
|
} set {
|
||||||
|
Condition.IncludeACL = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 跳过
|
/// 跳过
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -49,13 +49,13 @@ namespace LeanCloud.Storage {
|
||||||
|
|
||||||
public bool EmailVerified {
|
public bool EmailVerified {
|
||||||
get {
|
get {
|
||||||
return (bool)this["emailVerified"];
|
return Convert.ToBoolean(this["emailVerified"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool MobileVerified {
|
public bool MobileVerified {
|
||||||
get {
|
get {
|
||||||
return (bool)this["mobilePhoneVerified"];
|
return Convert.ToBoolean(this["mobilePhoneVerified"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue