---
title: "Linq Inner Join with OR condition."  
description: "Linq Inner Join with OR condition."  
author: "Norman Reedus"  
published: 2016-03-15  
updated: 2016-03-15  
canonical: https://www.mindstick.com/forum/34060/linq-inner-join-with-or-condition  
category: "linq"  
tags: ["c#", "linq", "mvc"]  
reading_time: 1 minute  

---

# Linq Inner Join with OR condition.

We want to [Inner Join](https://www.mindstick.com/forum/33572/sql-inner-join-keyword) with OR [condition](https://www.mindstick.com/forum/12711/select-query-with-and-condition) in linq. How to Write this [query](https://www.mindstick.com/blog/202/sub-query-in-sqlserver) please help me.

## Replies

### Reply by Anonymous User

when we need to apply inner [join](https://www.mindstick.com/articles/1487/join-sleep-and-interrupt-methods-in-c-sharp-threading) with or condition. To write query for inner join with or condition we need to use || operator in where condition as shown below:

```
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace ForumMVC.Controllers
{
    public class HomeController : Controller
    {
        forumEntities context = new forumEntities();
        public ActionResult Index()
        {
            var q = (from prd in context.ProductStock
                 from ord in context.ProductOrder
                   where (prd.ProductName==ord.ProductName || ord.ManufacturedBy==prd.ManufacturedBy)
                    select new
                    {
                        ord.OrderId,
                        prd.ProductId,
                        prd.ProductName,
                        prd.ManufacturedBy,
                        ord.OrderDate,
                        ord.OrderQty
                    }).ToList();

            return View();
        }
    }
}
```

![Linq Inner Join with OR condition.](https://www.mindstick.com/mindstickforums/eebea168-23c5-4881-903e-28691d6d8546/images/9abe4ef9-2f16-40ad-8a0f-4a912a4a65e2.png)


---

Original Source: https://www.mindstick.com/forum/34060/linq-inner-join-with-or-condition

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
