Alias tables to "var names"
When I copy/paste from Visual Studio to LINQPad (and back) I have to rename all the table variables to the real table names.
If I could alias a table, e.g. "Products" into "myProductsTable" the transition from VS to LP would be smooth.
How do I do that?
Bear in mind that you can also create a connection in LINQPad that consumes the typed DataContext that you've created in VS. This will ensure a perfect match with VS.
I just had another case for this need. Not sure how easy it is to resolve.
In my Linq code, I compare a database field to a win control value: "numericUpDownThreshold.Value".
Again, if I work on a piece of code, setting aliases to all these names helps.
I hear ya. Didn't think about it and it's a good temp workaround.
The way I use LP (great tool! thanks!) is move back and forth from VS.
Now I have to add 3-4 lines of code every time I copy/paste between them.
It works, but aliases would make it easier/transparent.
You can do this right now:
var custs = Customers;
custs.Where (c => c.Name.StartsWith ("A")).Dump();