EDUDOTNET

Thursday, May 8, 2014

Entity Framework 4 - What is the syntax for joining 2 tables then paging them?

Example of joining two tables - Entity Framework

var data = db.Categorie   
   .Join(db.CategoryMap, 
      cat => cat.CategoryId,    
      catmap => catmap.ChildCategoryId, 
      (cat, catmap) => new { Category = cat, CategoryMap = catmap }) 
   .Select(x => x.Category);


 

See more details : http://stackoverflow.com/questions/10222255/entity-framework-4-what-is-the-syntax-for-joining-2-tables-then-paging-them/10222383#10222383
 

0 comments:

Post a Comment