title: How should I return two lists of objects from one Controller Action?
body: <p>I am having two different list coming from same object. I want to get those two at same time as separate list or join those two same list when returning JSON object.</p>
  
  <p>Here is my code.</p>
  
  <pre><code>List&lt;User&gt; userEntity = users.Where(s =&gt; s.Id == Id).ToList();
  
  var GetUserNames = userEntity.SelectMany(s =&gt; s.Names.Select(u =&gt;
      new
      {
          Name = u.Name,
          Id = u.Id
      })).ToList();
  
  var GetProfile = userEntity.SelectMany(s =&gt; s.Profile.Select(u =&gt;
      new
      {
          Name = u.Name,
          Id = u.Id
      })).ToList();
  
  return Json(GetUserNames, JsonRequestBehavior.AllowGet);
  </code></pre>