Linq for adding items to list collection

Posted by balajirnaukri-12656 under Silverlight on 5/4/2012 | Points: 10 | Views : 1752 | Status : [Member] | Replies : 1
I need the linq to add items to the List<class> from the set of count instead of forloop

Thanks and Regards
Balaji.R
ASP.NET Devloper
Solve-IT corp



Responses

Posted by: Superb1986 on: 7/1/2012 [Member] Starter | Points: 25

Up
0
Down
Hi,
You can add this way

            var itemList = from item in objProvider.ReturnData()

where item.Name.Contains("A")
select item;

ObservableCollection<DataObjects> objList = new ObservableCollection<DataObjects>(itemList);


balajirnaukri-12656, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response