返回LinqDataSource中的修改字段

时间:2009-12-15 06:00:53

标签: c# asp.net linqdatasource

我有LinqDataSource喜欢这个:

<asp:LinqDataSource ID="linqDSUsers" runat="server" 
     ContextTypeName="Repository.BBDatabaseDataContext" 
     Select="new (UserID,FirstName,LastName)" TableName="Users">
</asp:LinqDataSource>

如何将其转换为:

<asp:LinqDataSource ID="linqDSUsers" runat="server" 
     ContextTypeName="Repository.BBDatabaseDataContext" 
     Select="new (UserID,FullName = FirstName + LastName)" TableName="Users">
</asp:LinqDataSource>

非常感谢你。

1 个答案:

答案 0 :(得分:3)

Select="new (UserID, FirstName + LastName As FullName)"