Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# lambda join two tables

    var UserInRole = db.UserProfiles.
        Join(db.UsersInRoles, u => u.UserId, uir => uir.UserId,
        (u, uir) => new { u, uir }).
        Join(db.Roles, r => r.uir.RoleId, ro => ro.RoleId, (r, ro) => new { r, ro })
        .Where(m => m.r.u.UserId == 1)
        .Select (m => new AddUserToRole
        {
            UserName = m.r.u.UserName,
            RoleName = m.ro.RoleName
        });
Comment

PREVIOUS NEXT
Code Example
Csharp :: enumerable.range contains 
Csharp :: how to see image from website in wpf 
Csharp :: c# convert stream to memorystream 
Csharp :: c# contains 
Csharp :: c# get char from string 
Csharp :: add all elements in a list c# 
Csharp :: c# optional parameters 
Csharp :: gameobject on click unity 
Csharp :: getcomponent unity 
Csharp :: unity play sound effect 
Csharp :: initialize list in c# 
Csharp :: winforms C# code cross thread operation is not valid 
Csharp :: turn list of string to csv c# 
Csharp :: convert string to number c# 
Csharp :: c# last char in string 
Csharp :: c# razor add disabled to button if 
Csharp :: roman to int 
Csharp :: string to camel case c# 
Csharp :: get sha1 of file c# 
Csharp :: c# do while 
Csharp :: list search c# 
Csharp :: c# dictionary keys to list 
Csharp :: C# Http.HttpRequestMessage 
Csharp :: generate random dark colors programatically in android 
Csharp :: asp.net mvc image upload 
Csharp :: The foreach Loop c# 
Csharp :: c# get property type of list 
Csharp :: check if an object is active unity 
Csharp :: c# close form 
Csharp :: c# get serial ports 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =