title: Can a DbContext enforce a filter policy?
body: <p>I would like to pass a value to the ctor of a DbContext and then have that value enforce "filtering" on the related DbSets.  Is this possible...or is there a better approach?</p>
  
  <p>Code might look like this:</p>
  
  <pre><code>class Contact {
    int ContactId { get; set; }
    int CompanyId { get; set; }
    string Name { get; set; }
  }
  
  class ContactContext : DbContext {
    public ContactContext(int companyId) {...}
    public DbSet&lt;Contact&gt; Contacts { get; set; }
  }
  
  using (var cc = new ContactContext(123)) {
    // Would only return contacts where CompanyId = 123
    var all = (from i in cc.Contacts select i);
  
    // Would automatically set the CompanyId to 123
    var contact = new Contact { Name = "Doug" };
    cc.Contacts.Add(contact);
    cc.SaveChanges();
  
    // Would throw custom exception
    contact.CompanyId = 456;
    cc.SaveChanges;
  }
  </code></pre>