{"action":"created","issue":{"url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/194","labels_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/194/labels{/name}","comments_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/194/comments","events_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/194/events","html_url":"https://github.com/fsprojects/SQLProvider/issues/194","id":123110263,"number":194,"title":"String concatenation within the query doesn't work","user":{"login":"Thorium","id":229355,"avatar_url":"https://avatars.githubusercontent.com/u/229355?v=3","gravatar_id":"","url":"https://api.github.com/users/Thorium","html_url":"https://github.com/Thorium","followers_url":"https://api.github.com/users/Thorium/followers","following_url":"https://api.github.com/users/Thorium/following{/other_user}","gists_url":"https://api.github.com/users/Thorium/gists{/gist_id}","starred_url":"https://api.github.com/users/Thorium/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Thorium/subscriptions","organizations_url":"https://api.github.com/users/Thorium/orgs","repos_url":"https://api.github.com/users/Thorium/repos","events_url":"https://api.github.com/users/Thorium/events{/privacy}","received_events_url":"https://api.github.com/users/Thorium/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-19T20:57:48Z","updated_at":"2015-12-20T21:21:10Z","closed_at":null,"body":"I try to do this:\r\n\r\n    let query = \r\n        query {\r\n            for cust in dc.Main.Customers do\r\n            select (cust.CompanyName + \" \" + cust.CompanyName)\r\n        }\r\n\r\nIt worked on the NuGet version but doesn't work with the GitHub version.\r\nGitHub version fails with:\r\n\r\n\tThe binary operator Add is not defined for the types 'System.String' and 'System.String'.\",\"T\":\"   \r\n\t   at System.Linq.Expressions.Expression.GetUserDefinedBinaryOperatorOrThrow(ExpressionType binaryType, String name, Expression left, Expression right, Boolean liftToNull)\r\n\t   at System.Linq.Expressions.Expression.Add(Expression left, Expression right, MethodInfo method)\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 64\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 64\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 64\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 64\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@118-8.Invoke(Expression a) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 118\r\n\t   at Microsoft.FSharp.Collections.IEnumerator.map@107.DoMoveNext(b& )\r\n\t   at Microsoft.FSharp.Collections.IEnumerator.MapEnumerator`1.System-Collections-IEnumerator-MoveNext()\r\n\t   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n\t   at System.Dynamic.Utils.CollectionExtensions.ToReadOnly[T](IEnumerable`1 enumerable)\r\n\t   at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable`1 arguments)\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 118\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform@49(List`1 tupleIndex, ParameterExpression resultParam, FSharpMap`2 aliasEntityDict, Dictionary`2 projectionMap, FSharpOption`1 en, Expression e) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 123\r\n\t(...cutted some loop here, expression tree recursion I suppose...)\r\n\tFSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.transform[a](Expression projection, List`1 tupleIndex, ParameterExpression resultParam, a baseTableAlias, FSharpMap`2 aliasEntityDict) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 146\r\n\t   at FSharp.Data.Sql.QueryExpression.QueryExpressionTransformer.convertExpression(SqlExp exp, List`1 entityIndex, IDbConnection con, ISqlProvider provider) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.QueryExpression.fs:line 169\r\n\t   at FSharp.Data.Sql.Runtime.QueryImplementation.executeQuery(ISqlDataContext dc, ISqlProvider provider, SqlExp sqlExp, List`1 ti) in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.Linq.fs:line 36\r\n\t   at FSharp.Data.Sql.Runtime.QueryImplementation.SqlQueryable`1.System-Collections-Generic-IEnumerable`1-GetEnumerator() in C:\\\\git\\\\SQLProvider\\\\src\\\\SQLProvider\\\\SqlRuntime.Linq.fs:line 77\r\n\t   at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)\r\n\t(...and this is the query evaluation...)\r\n\r\nBut to be able to really investigate this it would be nice if the unit tests would work!\r\n"},"comment":{"url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/comments/166155727","html_url":"https://github.com/fsprojects/SQLProvider/issues/194#issuecomment-166155727","issue_url":"https://api.github.com/repos/fsprojects/SQLProvider/issues/194","id":166155727,"user":{"login":"pezipink","id":2384821,"avatar_url":"https://avatars.githubusercontent.com/u/2384821?v=3","gravatar_id":"","url":"https://api.github.com/users/pezipink","html_url":"https://github.com/pezipink","followers_url":"https://api.github.com/users/pezipink/followers","following_url":"https://api.github.com/users/pezipink/following{/other_user}","gists_url":"https://api.github.com/users/pezipink/gists{/gist_id}","starred_url":"https://api.github.com/users/pezipink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pezipink/subscriptions","organizations_url":"https://api.github.com/users/pezipink/orgs","repos_url":"https://api.github.com/users/pezipink/repos","events_url":"https://api.github.com/users/pezipink/events{/privacy}","received_events_url":"https://api.github.com/users/pezipink/received_events","type":"User","site_admin":false},"created_at":"2015-12-20T21:21:10Z","updated_at":"2015-12-20T21:21:10Z","body":"Ha!  It is certainly not for the faint of heart!\r\n\r\nOn this problem, if this used to work but doesn't anymore, what I suspect is that before when it was working, it was doing the concatenation client side, but since I re-wrote the projection transformation from using the LINQ mutable tree transforming visitor thing to the immutable version, I have messed something up.  \r\n\r\nReally this kind of thing *could* be done server side as well, but it should not be too hard to get it working client-side again, the tree transforming thing is probably either doing something wrong, or going too deep when it should just stop.   (just a theory, might be totally wrong !)"}}