Q1. How do I manually create a dead-simple entity framework model for a one-column table in my database, and query it?
The table looks like this:
CREATE TABLE dbo.MyTable (
Value int NOT NULL CONSTRAINT PK_MyTable PRIMARY KEY CLUSTERED
);
And I have a POCO to map to it:
public class MyTable {
public int Value { get; set; }
}
Q2. Then, how do I query MyTable
with an Expression<Func<MyTable, bool>>
lambda that will decide which rows to return and will get projected into the SQL?
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.