How to write simple code in LInq
        Posted  
        
            by user281180
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by user281180
        
        
        
        Published on 2010-05-03T05:40:57Z
        Indexed on 
            2010/05/03
            5:48 UTC
        
        
        Read the original article
        Hit count: 283
        
c#
I have the following in my NotSelectedList.
public List<TestModel> SelectedList = new List<TestModel>();
public List<TestModel>NotSelectedList =  new List<TestModel>();
NotificationDetailsModel projects = new NotificationDetailsModel();
projects.ProjectID = Convert.ToInt32(Row["ProjectID"]);
projects.Valid= Convert.ToBoolean(Row["Validity"]);
NotSelectedList.Add(projects);
How can I write a simple code in LINQ to select from the NotSelectedList where Validity == True and store the data in SelectedList?
© Stack Overflow or respective owner