title: Access to value in ASP.NET Model, not in database, for linq query
body: <p>I'm building the front-end of this web app in Angular 5, and back-end in ASP.NET 4.6.1, Entity Framework 6.2.0. I built a POST http call in Angular to post an int (from a option dropdown list) to a model in the back-end. This model called <code>ViewModelLocation</code> is supposed to store this value (the location number) so that I can access the location number in a linq query. </p>
  
  <p>Therefore, I do not want this value to post to the database (no table for this in database) because I only want to use this number to filter, and get all students at the location number (selected in Angular). The post call seems to work, but I do not know how to write this linq query (since this number is not in my database) and return the students. I may be going about this the wrong way (?) I also would like to see what this value is once it posts to the back-end.</p>
  
  <p>Here is my attempt at the linq, in the StudentsController...</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Data;
  using System.Data.Entity;
  using System.Data.Entity.Infrastructure;
  using System.Linq;
  using System.Net;
  using System.Net.Http;
  using System.Web.Http;
  using System.Web.Http.Description;
  using ContentMastAPI.Models;
  
  namespace ContentMastAPI.Controllers
  {
      public class StudentsController : ApiController
      {
          private Model1 db = new Model1();
  
          // GET: api/Students
          public IQueryable&lt;Student&gt; GetStudents()
          {
              // TRYING TO RETURN ALL STUDENTS FROM SELECTED LOCATION
              var returnStudents = db.Students.Where(s =&gt; s.location == ViewModelLocation.OptionSelectId);
  
              return returnStudents;
  
              return db.Students;
          }
      }
  } 
  </code></pre>
  
  <p>Here is my model class:</p>
  
  <pre><code>using System.ComponentModel.DataAnnotations;
  using System.Linq;
  using System.Web;
  
  namespace ContentMastAPI.Models
  {
      public class ViewModelLocation
      {
          [Key]
          public int OptionSelectId { get; set; }
      }
  }
  </code></pre>