Select data from multiple tables using LINQ


Below is the query, if you want to select data from multiple tables using LINQ

 var yourvarname = (from ft in db.firsttables
                                join st in db.secondtables on ft.UserID equals st.UserID
                                where ft.UserID.Equals(st.UserID)
                                select new { st, ft }).SingleOrDefault();

Note:
db = your database object
firsttables = your first table name
secondtable = your second table name

You can ask in comments, if there is any query.

Comments

Popular posts from this blog

Ericsson BSCS iX R18 Billing & Rating (ADMX, MX) - Stored XSS (CVE-2020-29144, CVE-2020-29145)

Enjay CRM 1.0 - Multiple code executions via Unrestricted Terminal

ZKBio Time - CSV Injection (CVE-2022-40472)