Home

any existing "run linqpad via web" thingy out there?

On occasion there are instances where I have made a few simple ad-hoc-ish linqpad scripts for checking on the status of something, or doing some quick stats/calculations/whatever. Sharing those results with others typically means using the data grids and exporting to excel.

Since linqpad already includes all the support for serializing results to html, though, it seems like you could do something like have an MVC site that had a route of /linqpad/{script} and the method takes the script parameter, runs that file (the script has to already be present local to the server, no running of arbitrary scripts :), gets the html output and sends it back to the client.

Passing in additional parameters to the route and through to the script seems like the next step, but I don't really need it for the 'sharing some ad-hoc scripts in a simple manner' use case I'm trying to target. :)

Does such a thing already exist? I couldn't find anything in the FAQ nor with some searches, but I'm not sure what the right terms would be to search on to find such a thing if it did exist. :)

Thanks!!

Comments

  • I'm not sure if this is what you're looking for, but you can run Linqpad from the web: http://linqpad4.s3.amazonaws.com/LINQPad.htm However, it does only work in Chrome and requires a plugin called Roozz to work.
  • @SamuelJones - nope, although I've used that in the past just to play with it.

    I guess in order to better explain, let me describe what one possible 'brute-force' version would be:

    The 'bridge' would be an ASP.NET MVC app I would run on a machine that has LINQPad installed. My co-workers that I want to share scripts with (but I don't want them to have to install LINQPad, in particular since some of them aren't on Windows) would be able to hit the MVC app at http://machine/linqpadbridge/runscript/foo.linq with a route that LINQPadBridgeController and RunScript method that accepted a "string scriptName" parameter.

    It would then use whatever automation interface (worst-case, something like AutoHotKey) to run an instance of LINQPad, have it load the 'foo.linq' script, switch to 'html' output if 'data grid' is selected, and run the 'foo.linq' script (in this version, not passing any parameters to the script), wait for it to finishing rendering the script output. Once done, it would grab the html and send it back to the browser (or whatever http client made the request).

    Now, there are likely better/simpler/easier automation interfaces, and certainly if the script in question is just running some SQL or LINQ-to-SQL, you might be able to get away with something that just grabbed the contents of the script and ran it, but for the general case, trying to replicate what LINQPad can do is far more effort (as I'm guessing Joe can attest to :) than just trying to do some kind of automation of it. :)

    I'm *really* hoping that someone's done this kind of 'bridge' (or at least something similar) already. I had really hoped that Harry McIntyre's 'LINQPadRunner' would do the trick, but it doesn't appear to actually use LINQPad, just grab the contents of the script, compile it, and run it (so it doesn't have things like the LINQPad-generated data context that a 'typical' LINQPad script would have, although you can certainly use your own data context)

    Anyway, sorry for the long comment, and thanks again, Samuel!

    James
Sign In or Register to comment.