In my previous blog post on SharePoint LINQ, we discussed about using SPMetal command and to create a code file with autogenerated code, containing entity classes, which we named "MyDataFile.cs"
Now you first need to get DataContext object, then you can write your SharePoint LINQ query. After executing LINQ query you get the desired data, you can enumerate this data using foreach loop. If you want, you can also use the "ToList" method to return a generic list and can perform SharePoint LINQ to Object operations.
DataContext Object
↧
How to Use DataContext Object using LINQ and SPMetal in SharePoint
↧