开发者

Concat string with return column in SELECT in EF

开发者 https://www.devze.com 2023-03-28 16:21 出处:网络
Please see code. return from org in context.Organizations select new { PlaceId = org.OrganizationId, org.Name

Please see code.

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

How to concat some string with Name in above query, like

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

Thanks.


Maybe?

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

精彩评论

暂无评论...
验证码 换一张
取 消