2011-08-17 107 views
1

请参阅代码。在EF的SELECT中返回列的Concat字符串

return from org in context.Organizations 
        select new 
        { 
         PlaceId = org.OrganizationId, 
         org.Name 
        }; 

如何Concat的一些字符串在上面的查询名称,就像

return from org in context.Organizations 
        select new 
        { 
         PlaceId = org.OrganizationId, 
         org.Name + "Some string will go here" // Error: How to do this 
        }; 

感谢。

+0

你有哪个错误? – sll

回答

2

也许?

select new 
{ 
    PlaceId = org.OrganizationId, 
    Name = org.Name + "Some string will go here" // Error: How to do this 
}; 
+0

@Vladmir完美! – Kashif