Thursday, September 27, 2012

Using Joins Linq in asp.net

 var query = Entities.admin      
                    .Join(Entities.adminpermissions,       
                    c => c.ID,        
                    cm => cm.PID,  
                    (c, cm) => new { PRead = cm.PRead, UserId = cm.UserID, ID = cm.ID }) // project result
                    .Where(x => x.UserId == userID);  // select result

No comments:

Post a Comment

Comments

Search

Custom Search
Protected by Copyscape Plagiarism Software