Vic
Vic

Reputation: 950

In LINQPad LinqToSql query with database context

I aways copy LINQtoSql query from code to LINQPad for testing, but it have a little inconvenient of this.

My code:

enter image description here

But when I copy it to LINQPad for testing:

enter image description here

LINQPad can't recognizing the database context "db", so I have to remove "db" manually.

Is there any way to solve this problem?

Upvotes: 1

Views: 104

Answers (1)

sgmoore
sgmoore

Reputation: 16067

Start your query with the line

var db = this;

Upvotes: 2

Related Questions