receiving strongly-typed results from other scripts?
With recent LINQPad versions (running queries in separate processes, debugger support), I'm guessing this might be easier than it would have been in the past, but could be wildly wrong.
I'm trying to avoid having 'My Extensions' and the plugins folder as a bit of a dumping ground that collects any bits of shared logic I want for multiple scripts. What'd I'd really like to have instead is something akin to require('foo') from node/npm or ES6 or the like.
Currently if I have another script that I want to run and get the results back to the calling script, I end up having to define the "data transfer" class in both scripts, have the one write them out, have the caller Util.Run it with csv output, then use something like the CsvHelper nuget package in order to 'deserialize' it back to the strong types. Another option would be having the called script write out JSON, call it with text format, then deserialize that, but it's still the same problem.
I'd love to be able to run something like:
Thanks!
I'm trying to avoid having 'My Extensions' and the plugins folder as a bit of a dumping ground that collects any bits of shared logic I want for multiple scripts. What'd I'd really like to have instead is something akin to require('foo') from node/npm or ES6 or the like.
Currently if I have another script that I want to run and get the results back to the calling script, I end up having to define the "data transfer" class in both scripts, have the one write them out, have the caller Util.Run it with csv output, then use something like the CsvHelper nuget package in order to 'deserialize' it back to the strong types. Another option would be having the called script write out JSON, call it with text format, then deserialize that, but it's still the same problem.
I'd love to be able to run something like:
var resultsFromOtherScript = Util.Run>("OtherScript.linq");Is this something that either there's already existing support for (and I'm just missing it) or could be added in the future?
Thanks!
Comments
It was meant to be Util.Run[List[MyResultClass]](...)
Sorry for the noise.
(DateTime) Util.Compile ("myquery.linq").Run(QueryResultFormat.Text).ReturnValue
The object returned can be any serializable type that's accessible to both queries, (including a type defined in My Extensions, or a type defined in the plugins folder, although this may not help you if the aim is to avoid having shared types defined here).