---
title: "How to Use join in Linq query  mvc ."  
description: "How to Use join in Linq query  mvc ."  
author: "Anonymous User"  
published: 2015-11-30  
updated: 2015-11-30  
canonical: https://www.mindstick.com/forum/33665/how-to-use-join-in-linq-query-mvc  
category: ".net"  
tags: ["linq", "bootstrap", "mvc"]  
reading_time: 1 minute  

---

# How to Use join in Linq query  mvc .

I want to use Use [join](https://www.mindstick.com/articles/1487/join-sleep-and-interrupt-methods-in-c-sharp-threading) in [Linq query](https://www.mindstick.com/forum/33908/how-to-select-and-retrieve-data-using-linq-query-in-entity-framework) please help me.

## Replies

### Reply by Anonymous User

[LINQ](https://www.mindstick.com/articles/12007/language-integrated-query-linq-queries) has a JOIN [query](https://www.mindstick.com/blog/202/sub-query-in-sqlserver) operator that provides SQL JOIN like behavior and syntax. As you know, Inner join returns only those records or rows that match or exists in both the tables.

```
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;using System.Threading.Tasks;using System.Diagnostics;using ForumMVC;using System.Threading;using ForumMVC;namespace ForumMVC.Controllers{    public class HomeController : Controller    {        forumEntities  db = new forumEntities();        public ActionResult Index()        {            var result = from t in db.Customer                         join x in db.Order on t.CustomerID equals x.CustomerID                         select (new CustomerData {CustomerID=t.CustomerID,CustomerName=t.CustomerName,Amount=x.amount });                                     return View(result.ToList());        }           }   public  class CustomerData    {       public int CustomerID { get; set; }       public string CustomerName { get; set; }       public decimal? Amount { get; set; }    }}
```

```
 @model IList<ForumMVC.Controllers.CustomerData> @using ForumMVC.Controllers;<link href="~/Content/bootstrap.css" rel="stylesheet" /><table class="table table-hover table-bordered table-condensed table-striped">    <thead>      <tr>        <th>CustomerID</th>        <th>Customer Name</th>        <th>Amount</th>      </tr>    </thead>    <tbody>       @foreach(CustomerData obj in Model)       {      <tr>        <td>@obj.CustomerID</td>        <td>@obj.CustomerName</td>        <td>@obj.Amount</td>      </tr>       }          </tbody>  </table>
```

![How to Use join in Linq query  mvc .](https://www.mindstick.com/mindstickforums/bbc89941-8b0b-4e7b-a180-78df5b71e521/images/c9a4b3b3-1d6d-4790-9ebc-2850e5d2bfa2.png)


---

Original Source: https://www.mindstick.com/forum/33665/how-to-use-join-in-linq-query-mvc

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
