public override object Execute(Expression expression) { var visitor = new SalesforceVisitor(SelectType); var cmd = visitor.Translate(PartialEvaluator.Eval(expression)); switch (visitor.QueryType) { case QueryTypeEnum.FirstOrDefault: return(GetEnumerable(cmd).FirstOrDefault()); case QueryTypeEnum.First: return(GetEnumerable(cmd).First()); case QueryTypeEnum.Single: return(GetEnumerable(cmd).Single()); case QueryTypeEnum.SingleOrDefault: return(GetEnumerable(cmd).SingleOrDefault()); case QueryTypeEnum.Count: return(GetCount(cmd)); case QueryTypeEnum.Any: return(GetCount(cmd) > 0); default: return(GetEnumerable(cmd)); } }
public string ToString(Expression expression) { var visitor = new SalesforceVisitor(SelectType); return(visitor.Translate(PartialEvaluator.Eval(expression))); }