* QueryCompositionalCondition.cs: chore
* QueryEqualCondition.cs: * QueryOperationCondition.cs:
parent
bd47c2e44e
commit
1823dd974b
|
@ -222,11 +222,7 @@ namespace LeanCloud.Storage.Internal {
|
|||
}
|
||||
|
||||
public void AddCondition(string key, string op, object value) {
|
||||
QueryOperationCondition cond = new QueryOperationCondition {
|
||||
Key = key,
|
||||
Op = op,
|
||||
Value = value
|
||||
};
|
||||
QueryOperationCondition cond = new QueryOperationCondition(key, op, value);
|
||||
AddCondition(cond);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
namespace LeanCloud.Storage.Internal {
|
||||
internal class QueryEqualCondition : IQueryCondition {
|
||||
string key;
|
||||
object value;
|
||||
readonly string key;
|
||||
readonly object value;
|
||||
|
||||
public QueryEqualCondition(string key, object value) {
|
||||
this.key = key;
|
||||
|
|
|
@ -2,29 +2,27 @@
|
|||
|
||||
namespace LeanCloud.Storage.Internal {
|
||||
internal class QueryOperationCondition : IQueryCondition {
|
||||
public string Key {
|
||||
get; set;
|
||||
}
|
||||
readonly string key;
|
||||
readonly string op;
|
||||
readonly object value;
|
||||
|
||||
public string Op {
|
||||
get; set;
|
||||
}
|
||||
|
||||
public object Value {
|
||||
get; set;
|
||||
public QueryOperationCondition(string key, string op, object value) {
|
||||
this.key = key;
|
||||
this.op = op;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public bool Equals(IQueryCondition other) {
|
||||
if (other is QueryOperationCondition otherCond) {
|
||||
return Key == otherCond.Key && Op == otherCond.Op;
|
||||
return key == otherCond.key && op == otherCond.op;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public IDictionary<string, object> ToJSON() {
|
||||
return new Dictionary<string, object> {
|
||||
{ Key, new Dictionary<string, object> {
|
||||
{ Op, Value }
|
||||
{ key, new Dictionary<string, object> {
|
||||
{ op, value }
|
||||
} }
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue