Suggestion: Export LINQPad generated context (source and/or assemblies)
It would be nice to be able to export the contexts generated by LINQPad. That way if we wanted to make some tweaks, we would be able to do so and then even add the modified context back, a way of scaffolding. Could be a useful learning tool for learning how one might build a data context from scratch.
Comments
In terms of making tweaks, one of the difficulties with editing the source is that there's no nice way to merge the tweaked source with any new objects that you might want to add after you create new tables, views or SPs. It would also break a query's portability, unless the entire tweaked data context was stored inside every query.
I'm building out a set of EF Core 3.0 contexts with some specific tables and properties omitted and/or modified. I could use an external code generator or script one out to do a lot of this, but I would love it if LINQPad could be that code generator.
LINQPad's scaffolder is more robust, but it doesn't emit the code required to round-trip and recreate the database. This includes indexes, default values, constraints, etc. I'd probably this logged as a bug report. Is there any reason that the EF Core scaffolder wouldn't suffice?
The scaffolder would probably work fine. I'm just trying to set up an environment where everything could be done within LINQPad. For those who are adverse to using additional tools and wants an all-in-one solution, or close to it.