Home
Options

Entity Framework - no results

Greetings.

I'm new(ish) to Linqpad but I'm already wondering how people ever dealt with data before its inception.

I have an Entity Frame work 6.1.3 model I'm trying to run queries on in Linqpad 4.55.03. The connection loads the schema just fine but Blocks.Take (100) returns no results, there are 82 rows in the SQL Express database. I got Blocks.Take (100) from the right-click menu on the Blocks table in the DbContext listing.

Am I doin it wrong?

Here's a picture.

image

Comments

  • Options
    I'm not saying this is the problem, but I've never seen a *.DLL file listed as a connection as it is in the upper (failing) image.
  • Options
    Are you sure you've got a connection to the right database?

    You can test this by dumping 'this.Database' or similar.
  • Options
    Hi Folks, sorry about my delayed response - I've got kids.

    @klundberg yes, a DLL. It's an Entity Framework connection, in the Add Connection dialogue it's in the bottom section - Entity Framework (DbContext)

    @Joe - yup, it's the only database and the tables match. I think my issue is that I keep changing the database without using code-first migrations, today's error message is The model backing the 'UserQuery' context has changed since the database was created. Consider using Code First Migrations to update the database ....

    I'm using Database.SetInitializer(new DropCreateDatabaseIfModelChanges<AcadDbContext>()); in the DbContext constructor.
Sign In or Register to comment.