title: Manually create model for single table in Entity Framework
body: <p><strong>Q1.</strong> How do I manually create a dead-simple entity framework model for a one-column table in my database, and query it?</p>
  
  <p>The table looks like this:</p>
  
  <pre><code>CREATE TABLE dbo.MyTable (
      Value int NOT NULL CONSTRAINT PK_MyTable PRIMARY KEY CLUSTERED
  );
  </code></pre>
  
  <p>And I have a POCO to map to it:</p>
  
  <pre><code>public class MyTable {
      public int Value { get; set; }
  }
  </code></pre>
  
  <p><strong>Q2.</strong> Then, how do I query <code>MyTable</code> with an <code>Expression&lt;Func&lt;MyTable, bool&gt;&gt;</code> lambda that will decide which rows to return and will get projected into the SQL?</p>
  
  <p>I am relatively new to EF, but not to C# or software development. I'm asking this question because right now I just want to do a quick proof of concept of something in LINQPad, without using the EF Entity Data Model Wizard so it's easy to whip out code like this in the future.</p>