I'd like to be able to write against an object context variable within linq pad so the code is identical to what I'll be using in my production code. For instance if my object context variable was 'oc':
oc.Products.Where(p => p.Price > 10m);
Instead of:
Products.Where(p => p.Price > 10m);
Where the object context would be available in a variable name of my choosing instead of not using a local variable for the object context which is the same LINQPad works by default.
LINQPad subclasses the object context, so you can get to it via the 'this' keyword. Assigning it to a local variable will do what you want:
var oc = this;
oc.Products.Where (p => p.price > 10).Dump();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With