title: left join in linq and get the rows which have null value from right table
body: <p>I have this sql statemenet and now wants to right down this sql into linq c# </p>
  
  <pre><code>Declare @PageMenuId int 
  set @PageMenuId=131 
  select * from MenuMaster as M
  left join DynamicPages as P ON M.MenuId=P.PageMenuID 
  where  P.Id is null or P.PageMenuID =@PageMenuId
  </code></pre>
  
  <p>I have tried this but its not working for me rt now . </p>
  
  <pre><code>MenuMaster objMenuMaster = new MenuMaster();
              DynamicPageManager objDynamicPage = new DynamicPageManager();
              IList&lt;MenuMaster&gt; lstMenuMaster = new List&lt;MenuMaster&gt;();
              IList&lt;DynamicPage&gt; lstDynamicPage = new List&lt;DynamicPage&gt;();
              IList&lt;MenuMaster&gt; resultMenuMaster = new List&lt;MenuMaster&gt;();
              try
              {
  
                  lstMenuMaster = GetAll().ToList();
                  lstDynamicPage = objDynamicPage.GetAll().ToList();
  
  
                   resultMenuMaster = from m in lstMenuMaster
                              join p in lstDynamicPage on m.MenuId equals p.PageMenuID into gj
                          from subpet in gj.DefaultIfEmpty()
                              where (subpet.Id == null) || (subpet.PageMenuID == PageId)
                                      select new MenuMaster  {
  
  
  
                                      };
  
              }
              catch (Exception ex)
              {
                  _ErrorLog.CreateErrorLog(ex.Message, ex);
  
              }
              return resultMenuMaster;
  </code></pre>