public override bool Apply(DatastoreEntry <T> e) { switch (Operator) { case Operator.Equal: return(e.DatastoreKey.Equals(DatastoreKey)); case Operator.NotEqual: return(!e.DatastoreKey.Equals(DatastoreKey)); case Operator.GreaterThan: return(e.DatastoreKey > DatastoreKey); case Operator.GreatherThanOrEqual: return(e.DatastoreKey >= DatastoreKey); case Operator.LessThan: return(e.DatastoreKey < DatastoreKey); case Operator.LessThanOrEqual: return(e.DatastoreKey <= DatastoreKey); default: throw new Exception($"unknown operator '{Operator}'"); } }
public override bool Apply(DatastoreEntry <T> e) { switch (Operator) { case Operator.Equal: return(Value.Equals(e.Value)); case Operator.NotEqual: return(!Value.Equals(e.Value)); default: throw new Exception($"cannot apply operator '{Operator}' to '{typeof(T)}'"); } }
public DatastoreResult(DatastoreEntry <T> e) : base(e.DatastoreKey, e.Value) { }
public abstract bool Apply(DatastoreEntry <T> e);
public override bool Apply(DatastoreEntry <T> e) => e.DatastoreKey.ToString().StartsWith(Prefix);