Home > Enterprise >  In LINQPad LinqToSql query with database context
In LINQPad LinqToSql query with database context

Time:11-10

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?

CodePudding user response:

Start your query with the line

var db = this;

CodePudding user response:

Assuming that "db" is a the name of your Data Context, is it instantiated, in linq pad?

  • Related