Two Type Linq Joining Query

 int RoleID = Convert.ToInt32(Role);
             var Email = (from contact in dc.tbl_Contact
                          join usr in dc.tbl_User on contact.ContactID equals usr.ContactID
                          join usrrole in dc.tbl_UserRole on usr.UserID equals usrrole.UserID
                          join role in dc.tbl_Role on usrrole.RoleID equals role.RoleID
                          where contact.IsDelete == false && role.RoleID == RoleID

                          select new
                          {
                              emailcollection = contact.EmailIDOne
                          });
           

OR


             var xx = from tbl_UserRole ur in (dc.tbl_Role.Where(r => r.RoleID == RoleID).FirstOrDefault().tbl_UserRole)
                      select new
                      {
                          email = ur.tbl_User.tbl_Contact.EmailIDOne
                      };

Search This Blog

Arsip Blog

Powered by Blogger.

Recent

Comment

Author Info

Like This Theme

Popular Posts

Video Of Day

jishnukanat@gmail.com

Sponsor

Most Popular