LINQ to sharepoint. help

I am currently using SharePoint 2010, and at my business level I am using LINQ to SharePoint. I created all my Entity classes using SPMetal.

We are creating a library system, my system has 2 lists. The first is the contribution, and the second is the Contributor. Each Participant contains a link to the list of contributions (PrimaryISBN link). The tab list contains a list of books, and PrimaryISBN is not unique to this list.

Contribution

ID  PrimaryISBN      TITLE      
1   PRIM1            HardcoverLOTR      
2   PRIM1            AudioBookLOTR      
3   PRIM2            HardcoverHP        

Author

ID  Name  PrimaryISBNLookup
1   ABC   PRIM1
2   DEF   PRIM2

I am currently trying to get all books created by a specific user based on the name. My request is similar to this

var result = from _contributor in data.contributor
             where _contributor.Name= "ABC"
             select new Book
            {
               Title = contributor.PrimaryISBNLookup.Title
            }

, , , ISBN, ( , .. , ). 1 , 2 , ( Contribution), .

.

+3
2

, , , :

var results = from _contributor in data.contributor
              join _contribution in data.contribution
              on _contributor.PrimaryISBNLookup equals _contribution.PrimaryISBN
              where _contributor.Name == "ABC"
              select new Book
              {
                  Title = _contribution.Title
              }
+1

DataTable SPList, :

           SPList  cList = spWeb.Lists.TryGetList("Customer");
           SPList   oList = spWeb.Lists.TryGetList("Order");


            DataTable cTable= cList.Items.GetDataTable();
            DataTable oTable= oList.Items.GetDataTable();

            var coList = from tbl1 in cTable.AsEnumerable()
                         join tbl2 in oTable.AsEnumerable() on tbl1["Title"] equals           tbl2["CustomerName"]
                         select new
                         {
                             ItemName = tbl2["Title"],
                             CustomerName = tbl1["Title"],
                             Mobile = tbl1["MobileNo"]

                         };
0

All Articles