/// <summary> /// Translates the <paramref name="listExpression"/> into a string representation. /// </summary> /// <param name="listExpression">The <see cref="DbListExpression"/> to translate.</param> /// <returns><see cref="string"/></returns> protected override DbExpression VisitListExpression(DbListExpression listExpression) { if (listExpression.Count() == 0) return ExpressionFactory.Sql(string.Empty); //var syntax = listExpression.Select(e => Visit(e)).Aggregate((current, next) => current + "," + next); var syntax = listExpression.Select(e => Visit(e).ToString()).Aggregate((current, next) => current + "," + next); return ExpressionFactory.Sql(syntax); }
/// <summary> /// Translates the <paramref name="listExpression"/> into a string representation. /// </summary> /// <param name="listExpression">The <see cref="DbListExpression"/> to translate.</param> /// <returns><see cref="DbExpression"/></returns> protected virtual DbExpression VisitListExpression(DbListExpression listExpression) { DbExpression[] originalList = listExpression.ToArray(); var list = VisitListExpression(originalList); if (!ReferenceEquals(originalList, list)) return ExpressionFactory.List(list); return listExpression; }