title: Merging data from two lists conditionally
body: <p>Merging data from two lists conditionally</p>
  
  <p>table structure is as following</p>
  
  <pre><code>MobileID   ModelID   ManufacturerID    IsApproved
  </code></pre>
  
  <p>where IsApproved is boolean value,</p>
  
  <p>When new mobile entry done in database, it goes for the approval to the manager, till that it's IsApproved value is 0, when it gets approved IsApproved value will become 1.</p>
  
  <p>I want to do as following</p>
  
  <p>I am getting the list of all approved mobile using first query written below</p>
  
  <p>now problem is I have to display all the mobiles based on 2 conditions</p>
  
  <p>1) If a mobile exists with same modelID and manufacturerID (means the specification is updated) than it's IsApproved field will become 0 --> not in DB but into the list for display purpose only)</p>
  
  <p>2) If Mobile is new than it's IsApproved status should be 0</p>
  
  <p>What should I do to merge this two lists conditionally?</p>
  
  <p>My LINQ queries are as below</p>
  
  <pre><code>var listApproved = objMobile.MobileLists.where(mb =&gt; mb.IsApproved == true).toList();
  var listUnApproved = objMobile.MobileLists.where(mb =&gt; mb.IsApproved == false).toList();
  </code></pre>
  
  <p>Suppose table data is as following</p>
  
  <pre><code>MobileID    ModelID     ManufacturerID     IsApproved
  01            mod1             manu1               1
  02            mod2             manu2               1
  03            mod3             manu3               1
  04            mod1             manu1               0
  05            mod5             manu5               0
  06            mod6             manu6               0
  07            mod2             manu2               0
  </code></pre>
  
  <p>I Want the list as </p>
  
  <pre><code>MobileID    ModelID     ManufacturerID     IsApproved
  01            mod1            manu1            0
  02            mod2            manu2            0
  03            mod3            manu3            1
  05            mod5            manu5            0
  05            mod6            manu6            0
  </code></pre>