title: MVC4 append to existing class object
body: <p>I have ViewModel and I am doing </p>
  
  <pre><code>var model = from x in abc
              select new CompaniesVM { id = x.id ..etc}
  </code></pre>
  
  <p>then I want to execute another query and append the data to CompaniesVM instance. something like</p>
  
  <pre><code>var model2 = from f in def
              select new CompaniesVM {id = f.id ..etc}
  </code></pre>
  
  <p>then return the model to the view. I cannot use new keyword since It will create new instance object</p>
  
  <p>I tried to create a new instance at the beginning of the call <code>var companyList = new CompaniesVM();</code> and then instead of <code>select new CompaniesVM</code> do <code>select companyList {companyList.id = x.id}</code> but it gives me a compilation error does not find the x.id </p>
  
  <p>How do I fix it? </p>
  
  <p>UPDATE</p>
  
  <p>I need to execute the first condition then check if count()&lt;5 then execute the second condition and append the result into one viewmodel. cannot be in a single call.</p>