title: How to return list from linq query using viewmodels
body: <p>I have classes like this</p>
  
  <pre><code>public class class1
      {
          public int class1id { get; set; }
          public string name { get; set; }
      }
      public class class2
      {
          public int id { get; set; }
          public int class1id { get; set; }
          public string from { get; set; }
          public string to { get; set; }
      }
  
      public class viewmodel
      {
          public class2 deletedocument { get; set; }
          public IList&lt;class2&gt; deletelist { get; set; }
      }
  </code></pre>
  
  <p>Now i want to return a list with name,from,to properties. Here name from class1 and class1id is foreign key(class1). How can i do this? Do i need to change my viemodel? </p>