diff --git a/Storage/Storage/Internal/Query/QueryCompositionalCondition.cs b/Storage/Storage/Internal/Query/QueryCompositionalCondition.cs index 5a47a32..f2b87d8 100644 --- a/Storage/Storage/Internal/Query/QueryCompositionalCondition.cs +++ b/Storage/Storage/Internal/Query/QueryCompositionalCondition.cs @@ -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); } diff --git a/Storage/Storage/Internal/Query/QueryEqualCondition.cs b/Storage/Storage/Internal/Query/QueryEqualCondition.cs index eb08dee..9e9e152 100644 --- a/Storage/Storage/Internal/Query/QueryEqualCondition.cs +++ b/Storage/Storage/Internal/Query/QueryEqualCondition.cs @@ -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; diff --git a/Storage/Storage/Internal/Query/QueryOperationCondition.cs b/Storage/Storage/Internal/Query/QueryOperationCondition.cs index 5f52b6e..40c2b2a 100644 --- a/Storage/Storage/Internal/Query/QueryOperationCondition.cs +++ b/Storage/Storage/Internal/Query/QueryOperationCondition.cs @@ -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 ToJSON() { return new Dictionary { - { Key, new Dictionary { - { Op, Value } + { key, new Dictionary { + { op, value } } } }; }