Пример #1
0
        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}'");
            }
        }
Пример #2
0
        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)}'");
            }
        }
Пример #3
0
 public DatastoreResult(DatastoreEntry <T> e)
     : base(e.DatastoreKey, e.Value)
 {
 }
Пример #4
0
 public abstract bool Apply(DatastoreEntry <T> e);
Пример #5
0
 public override bool Apply(DatastoreEntry <T> e) => e.DatastoreKey.ToString().StartsWith(Prefix);