private Expression EvaluateHasItemsNode(CollectionHasItemsExpressionNode node) { var collection = this.ParseExpression(node.CollectionExpression); var count = node.CollectionExpression.ResultType.GetCollectionInterface().GetProperty("Count"); return(Expression.NotEqual(Expression.Property(collection, count), Expression.Constant(0))); }
private void EvaluateCollectionHasItemsExpressionNode(CollectionHasItemsExpressionNode node) { EvaluateExpressionAgainstModelOnStack(node.CollectionExpression); var count = node.CollectionExpression.ResultType.GetCollectionInterface().GetProperty("Count"); emitter.CallMethod(count.GetGetMethod()); emitter.LoadConstant(0); emitter.CompareEqual(); emitter.LoadConstant(0); emitter.CompareEqual(); }