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
163
votes
4 answers

LINQPad [extension] methods

Does anyone have a complete list of LINQPad extension methods and methods, such as .Dump() SubmitChanges()
Bent Rasmussen
  • 5,538
  • 9
  • 44
  • 63
74
votes
1 answer

Possible to clear the LINQPad results window with code?

Using LINQPad, using the extension method Dump(), Console.WriteLine or Debug.Writeline, the values will appear in the results window. Is there a way to clear this results window during the run of a linqpad script? As an example, I tried…
Ray Booysen
  • 28,894
  • 13
  • 84
  • 111
64
votes
4 answers

How does LINQPad reference other classes, e.g. Books in the LINQ in Action samples

I'm using LINQPad to create LINQ queries in an application I'm bulding. I noticed that in the downloaded LINQ in Action samples, e.g. example 4.04, intellisense shows a class "Books" but I don't see any references or "using" statements in the…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
63
votes
4 answers

How do I use the LINQPad Dump() extension method in Visual Studio?

LINQPad is amazing, and particularly useful is the Dump() extension methods which renders objects and structs of almost any type, anonymous or not, to the console. Initially, when I moved to Visual Studio 2010, I tried to make my own Dump method…
gav
  • 29,022
  • 23
  • 65
  • 90
62
votes
3 answers

Can I have an incrementing count variable in LINQ?

I want to do something like this: from a in stuff let counter = 0 select new { count = counter++, a.Name }; But I get a error telling me that counter is read only. Is there a way to do something similar to this, without declaring a variable outside…
Mike Pateras
  • 14,715
  • 30
  • 97
  • 137
60
votes
4 answers

How to add a reference to an assembly in LINQPad to access custom types?

Is there a posibility to add a reference to an assembly in LINQPad? I have some types in my assembly and I would like to use them in my LINQPad queries.
miron
  • 611
  • 1
  • 5
  • 4
58
votes
2 answers

How to submit changes in LinqPad

I have a problem with committing changes in LinqPad. I am using Oracle database over IQ driver in LinqPad. I can retrieve data but I don't know how to submit changes to database. I retrieve data from database: var items = Asyncqueue.Where(x =>…
bangoo
  • 668
  • 1
  • 8
  • 14
56
votes
8 answers

Is there any program like LINQPad for Java?

I've found LINQPad to be extremely useful when answering StackOverflow questions for C# or VB.NET. It allows me to write up some quick code, run it, and (if I want) see a nicely-formatted dump of the results. That way I can be sure that the code I…
StriplingWarrior
  • 151,543
  • 27
  • 246
  • 315
55
votes
3 answers

LINQPad script directory?

Does anyone know how to get hold of the path to the directory where the LINQPad script file (.linq) resides? Or to the script itself for that matter. Note that I'm not talking about the location of the "My Queries" folder, the one shown inside…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
54
votes
2 answers

Make internal classes visible to other assemblies

Is it possible to make internal classes from my assembly visible to other assemblies? I know about the AssemblyInfo file and the [assembly: InternalsVisibleTo()] attribute, but it doesn't work in my case. The main purpose is to make it possible to…
Neir0
  • 12,849
  • 28
  • 83
  • 139
52
votes
6 answers

LINQPad, using multiple datacontexts

I am often comparing data in tables in different databases. These databases do not have the same schema. In TSQL, I can reference them with the DB>user>table structure (DB1.dbo.Stores, DB2.dbo.OtherPlaces) to pull the data for comparison. I like…
Scott
49
votes
5 answers

How does LINQ expression syntax work with Include() for eager loading

I have a query below, but I want to perform an Include() to eager load properties. Actions has a navigation property, User (Action.User) 1) My basic query: from a in Actions join u in Users on a.UserId equals u.UserId select a 2) First…
jaffa
  • 26,770
  • 50
  • 178
  • 289
41
votes
3 answers

How to debug LinqPad query in Visual Studio Debugger?

I can attach the debugger and get it to break - but it has trouble finding the .cs file, I think LinqPad deletes it as part of its build.. 8-(
Mesh
  • 6,262
  • 5
  • 34
  • 53
40
votes
3 answers

Entity framework Include command - Left or inner join?

As I was investigating the difference between Include and Join I found that : If the DB does not include a Foreign Keys -it has no navigation props so it's better to use Join If It does have a navigation props - then use Include. ( it also save a…
Royi Namir
  • 144,742
  • 138
  • 468
  • 792
35
votes
4 answers

Is it possible to run LINQPad with Mono (Mac)

I have installed Mono 2.6.7 in Snow Leopard and would like to run LINQPad. I've gotten LINQPad (v2.21) to start but immediately get a FileNotFoundException. Has anyone been able to run it successfully? I assume the exception is because it's trying…
kwcto
  • 3,494
  • 2
  • 26
  • 33
1
2 3
67 68