开发者

How to get all Types using LINQ in Asp.net mvc

I have this code

 viewModel.Messages = repository.GetAllMes开发者_Go百科sages().OrderBy(x => x.MessageText);

with this I am getting 75 messges and i am displaying all the Messages in the Grid with two columns

MessageText and MessageType

But I need to write a Linq Query to get all my Distinct MessageTypes from Messages?

Can any body help me out?

thanks


repository.GetAllMessages().Select(m => m.MessageType).Distinct();
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜