如何在Entity Framework 4中连接字符串?我有来自一个列的数据,我想将其保存为以逗号分隔的字符串,例如"value1, value2, value3"
EF4 中是否有相应的方法或运算符?
例如:假设我有两个列和,它们的值如下所示:
- Apples
- Bananas
- Strawberries
var dataSource = this.context .Farms .Select(f => new { f.Id, Fruits = string.Join(", ", f.Fruits) });我会得到以下错误:
LINQ to Entities does not recognize the method 'System.String Join(System.String, System.Collections.Generic.IEnumerable`1[System.String])' method, and this method cannot be translated into a store expression.这个问题有解决方案吗?