小新新2015

导航

 
            var result = (from role in context.AccountRole
                         join s in context.AccountToRole.Where(s=>s.AccountID==41)
                         on role.ID equals s.RoleID into temp
                         from tt in temp.DefaultIfEmpty()
                         
                         select new
                         {
                             ID = role.ID,
                             RoleName = role.Description,
                             RoleID = tt.RoleID.ToString()
                         }).ToList();

 

posted on 2015-07-24 17:10  小新新2015  阅读(113)  评论(0编辑  收藏  举报