Home
Options

How to dump Util.Image() from statement

Hi,

I'm fresh new user of Linqpad and while learning I wanted to dump image from VB Statement, but can't figure how.

For example if I use VB expression:
Util.Image(some-url)
image is shown in Result pane, but if I use this VB statement:
Dim url As String = some-url
Util.Image(url)
Results pane is empty. I tried Dump() method, but it just raised exception.

I expect this to be trivial to regulars, so thought to ask for help.

TIA

Comments

  • Options
    You're on the right track, in that you must explicitly call Dump on anything you want displayed in Statements mode.

    The reason that you're getting an error when calling Dump is due to a limitation in VB. Dump is an extension method and VB does not let you call extension methods on an object type.

    You can either call Dump as a static method:
    Dim url As String = "http://www.linqpad.net/linqpadmed.png"
    LINQPad.Extensions.Dump (Util.Image (url))
    or else call Console.WriteLine. LINQPad rewires Console.WriteLine so that has the same effect as calling Dump:
    Dim url As String = "http://www.linqpad.net/linqpadmed.png"
    Console.WriteLine (Util.Image (url))
Sign In or Register to comment.