title: Return two lists to the view c# mvc
body: <p>I have two lists that i want to return to the view, 'added' and 'removed'. However currently i can only return either the 'added' or 'removed'. How can i return both in one object? I am very new to MVC so apologies if this code is messy!</p>
  
  <pre><code>public ActionResult Index()
      {
          // Excel upload history
  
          var fptexcel = db.FPTStaticDataRatedFinancialAssetBase
                         .OrderBy(e =&gt; e.FORATExcelId)
                         .Select(e =&gt; e.FORATExcelId).Max();
  
          var fptexcelprevious = fptexcel - 1;
  
          var newassets = db.FPTStaticDataRatedFinancialAssetBase.OfType&lt;FPTStaticDataRatedFinancialAssetBase&gt;()
                          .Where(c =&gt; c.FORATExcelId == fptexcel || c.FORATExcelId == fptexcelprevious)
                          .GroupBy(x =&gt; x.Name)
                          .Where(c =&gt; c.Count() == 1)
                          .Select(y =&gt; y.FirstOrDefault()).ToList();
  
          var added = db.FPTStaticDataRatedFinancialAssetBase.OfType&lt;FPTStaticDataRatedFinancialAssetBase&gt;()
                           .Where(x =&gt; x.FORATExcelId == fptexcelprevious)
                           .Select(x =&gt; x).ToList();
  
          var removed = db.FPTStaticDataRatedFinancialAssetBase.OfType&lt;FPTStaticDataRatedFinancialAssetBase&gt;()
                           .Where(x =&gt; x.FORATExcelId == fptexcel)
                           .Select(x =&gt; x).ToList();
  
          return View(newassets.Except(added).ToList());
  
      }
  </code></pre>