コード例 #1
0
 /// <summary>
 /// Clone
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public static FilterOperandModel Clone(this FilterOperandModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new FilterOperandModel {
         Alias = model.Alias,
         AttributeId = model.AttributeId,
         BrowsePath = model.BrowsePath,
         Index = model.Index,
         IndexRange = model.IndexRange,
         NodeId = model.NodeId,
         Value = model.Value
     });
 }
コード例 #2
0
 /// <summary>
 /// Compare operands
 /// </summary>
 /// <param name="model"></param>
 /// <param name="other"></param>
 /// <returns></returns>
 public static bool IsSameAs(this FilterOperandModel model, FilterOperandModel other)
 {
     if (model == null && other == null)
     {
         return(true);
     }
     if (model == null || other == null)
     {
         return(false);
     }
     if (model.AttributeId != other.AttributeId)
     {
         return(false);
     }
     if (model.Index != other.Index)
     {
         return(false);
     }
     if (!JToken.DeepEquals(model.Value, other.Value))
     {
         return(false);
     }
     if (!model.BrowsePath.SequenceEqualsSafe(other.BrowsePath))
     {
         return(false);
     }
     if (model.IndexRange != other.IndexRange)
     {
         return(false);
     }
     if (model.NodeId != other.NodeId)
     {
         return(false);
     }
     return(true);
 }