Questions tagged [linqpad]

A lightweight code scratchpad for C#/F#/VB and database querying tool that supports both SQL and LINQ. Written by Joe Albahari.

LINQPad can be downloaded free from http://www.linqpad.net. Its main features are:

  • Runs code snippets in C#, VB.NET and F#, for .NET 3.5, 4.0, 4.5 and 4.6.
  • Executes queries on databases and other sources directly in LINQ (or SQL).
  • Explicit support for popular APIs such as LINQ-to-SQL, Entity Framework and OData, and databases such as SQL/Azure, SQLite, MySQL, Oracle and PostgreSQL.
  • Allows referencing custom assemblies and NuGet packages.
  • Built-in "object dumper" to facilitate easy experimentation. Recognizes and specially formats output from popular APIs such as Reactive Extensions.
  • Command-line support for automating scripts.
  • Built-in autocompletion and debugging (license purchase required).

LINQPad is popular for testing C# snippets. It also has built-in samples to help with learning LINQ.

Another program similiar to linqpad is You even can query stackoverflow using linqpad

1017 questions
9
votes
3 answers

How do I view an expression tree with LINQPad?

Maybe I'm missing something obvious, but I how can I view the expression tree for this query: from word in "The quick brown fox jumps over the lazy dog".Split() orderby word.Length select word using LINQPad?
GuyBehindtheGuy
  • 1,368
  • 2
  • 17
  • 36
9
votes
1 answer

Using sqlfunctions in linqpad

My LinqPad is treating SqlFunctions as an unrecognized class. The intellisense is underlining the class. How can I call the library in my linqpad query?
Alwyn
  • 8,079
  • 12
  • 59
  • 107
9
votes
2 answers

Linqpad & EF5 Code First

Getting the following error when trying to run a query against a dbcontext assembly in Linqpad. InvalidOperationException: The model backing the 'UserQuery' context has changed since the database was created. Consider using Code First Migrations to…
dandcg
  • 442
  • 4
  • 16
9
votes
2 answers

Having trouble with LinqPad Adding a Connection to Entity Framework

I am new to Entity Framework and Linq to Entities and I want to try LinqPad but I can't figure out how to make a connection to the edmx model I have created. I have an MVC project and I added an ADO.Net Entity Data Model against a SQL Sever database…
Alan Fisher
  • 2,005
  • 4
  • 41
  • 61
8
votes
1 answer

IL Code of an interface

I am using LinqPad and in that I was looking at the IL code(compiler optimization switched on) generated for the following Interface & the class that implements the interface: public interface IStockService { [OperationContract] double…
Pawan Mishra
  • 7,212
  • 5
  • 29
  • 39
8
votes
3 answers

Scala tool similar to Linqpad

So I'm a huge fan of LinqPad, but not just for its little LINQ testing but for quick scratchpad development using C# or F# since it adds REPL to C#. Anyways, I know scala has an interactive windows but is there any sort of lightweight tool similar…
Mike
  • 1,297
  • 2
  • 14
  • 22
8
votes
1 answer

Is LINQPad's IL code the optimized version?

LINQPad has a tab near the results to show the IL of the C# statements you're running. I'm wondering if this is the optimized "Release" version of the code vs. the unoptimized "Debug" build of the code. Perhaps there is a simple way to check by…
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159
8
votes
2 answers

Drawing a new System.Drawing.Bitmap

This code generates an exception with the latest LINQPad 4.28 beta new System.Drawing.Bitmap(200, 200).Dump(); Is this a problem in my code or a problem with LINQPad's .Dump() extension method?
Bent Rasmussen
  • 5,538
  • 9
  • 44
  • 63
8
votes
3 answers

How to simulate ConfigurationManager in LINQPad

I'm trying to test some code in LINQPad. However, the base class calls Configuration Manager. How can I simulate that when testing in LINQPad. void Main() { var tRepo = new TestRepository(); var result = tRepo.GetAsync(1); …
M Kenyon II
  • 4,136
  • 4
  • 46
  • 94
8
votes
3 answers

How can you display a MessageBox dialog in a LinqPad query?

When running/debugging, calls to MessageBox, or Microsoft.VisualBasic.Interaction.MsgBox hang without showing any dialog. I think it's being blocked, but see no examples on how to resolve this.
WhiskerBiscuit
  • 4,795
  • 8
  • 62
  • 100
8
votes
3 answers

NLog via LINQPad - Where to put config file?

I'm trying to test NLog under LINQPad. I successfully linked it and my code compiles well. However, NLog doesn't write log files because it is not configured. I tried to make various config files like: NLog.config and LINQPad.config but it looks…
Miroslav Popov
  • 3,294
  • 4
  • 32
  • 55
8
votes
3 answers

Getting entity framework context in Linqpad?

I've created a DLL assembly which contains the edmx for northwind database. I created a reference to that dll through linqpad and I do see the db and able to run queries. But - I want to test the behavior of DeferredLoadingEnabled property and I…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
8
votes
1 answer

LinqPad - Export to Excel with NO formatting

I found this bit of code to export my data results to Excel: List users = .... var filename = "test.html"; var writer = LINQPad.Util.CreateXhtmlWriter(); writer.Write(users); System.IO.File.WriteAllText(filename, writer.ToString()); //…
inquisitive_one
  • 1,465
  • 7
  • 32
  • 56
8
votes
1 answer

Using LinqPad with SMO

I am trying to use the SMO for Sql Server 2008 R2 Standard, but I am running into an issue whenever I try to Dump an object. The relevant code: void Main() { var connectionString = @"Server=(local);Trusted_Connection=True;"; Server server =…
Dustin Kingen
  • 20,677
  • 7
  • 52
  • 92
8
votes
1 answer

How to quote identifiers with LINQPad + IQ Driver + MySQL?

I'm working with a rather horrible schema designed by an external party and it contains a table named order so when I invoke a query that references this table in LINQPad I get a SQL syntax error. I know how to quote the identifier in MySQL, but I…
Matt Siebert
  • 367
  • 1
  • 9