KEMBAR78
Entity Framework Core 5.0 does not support string.Concat with more than 2 args · Issue #23859 · dotnet/efcore · GitHub
Skip to content

Entity Framework Core 5.0 does not support string.Concat with more than 2 args #23859

@vsfeedback

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


A Query similar to:

From t In Me.DataStore.qryAbo
Where t.AboAdrKey = 1035
Order By t.AboActive Descending, t.PrdName, t.TypName
Select New With {t.AboKey, t.AboAdrKey, t.AboActive, . PrdName = String.Concat(t.PrdName, " ", t.TypName, If(t.AboTrial, " (Trial)", ""))}

gets translated to

DECLARE @__DataRow_AdrKey_0 int = 1035;
SELECT [q]. [AboKey], [q]. [AboAdrKey], [q]. [AboActive], [q]. [PrdName], [q]. [TypName], CASE WHEN COALESCE([q].[ AboTrial], CAST(0 AS bit)) = CAST(1 AS bit) THEN N' (Trial)'
    ELSE N''
END
FROM [qryAbo] AS [q]
WHERE COALESCE(CASE
    WHEN ([q].[ AboAdrKey] = @__DataRow_AdrKey_0) AND [q]. [AboAdrKey] IS NOT NULL THEN CAST(1 AS bit)
    ELSE CAST(0 AS bit)
END, CAST(0 AS bit)) = CAST(1 AS bit)
ORDER BY [q]. [AboActive] DESC, [q]. [PrdName], [q]. [TypName]

which brings back 6 columns instead of 4.

Is this by design or should System.Concat be supported?

Thank you for feedback.


Original Comments

May Lei [MSFT] on 12/13/2020, 11:39 PM:

Not sure the area path, please help to reassign if the area path is not correct. Thanks.

Travico Support on 12/15/2020, 05:19 AM:

(private comment, text removed)


Original Solutions

(no solutions)

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions