As a requirement, I came through a condition where I needed to query a C# list collection using LINQ.
The list was a collection of objects. The Object definition is as below:
- public class BOSampleBusinessObject
- {
- public int ID { get; set; }
- public string Name { get; set; }
- public string Decription { get; set; }
- }
-
After that I created a list of this object as follows and got data into is using simple ADO.NET:
- List<BOSampleBusinessObject> lstBOSampleBusinessObject = new List<BOSampleBusinessObject>;
- var ouputData = lstBOSampleBusinessObject.Where(x=> x.Name.Equals("Vipul"));
This gave me the correct queried data in my var object.
I can now use it in the way I want.
Hope this helped.
Thanks
Vipul

Bhuvanesh MohankumarPosted May 6, 2016, 3:57 PM
Good one...
Gowtham RajamanickamPosted Jul 9, 2015, 12:29 AM
good one...