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
6
votes
1 answer

Can I get at the DbContext created by LinqPad?

I am trying to test my IRepository interface via linqpad. To make one I have a constructor that looks like this: IRepository dataAccess = new GenericRepository(dbContext); This works fine in my own code, but I don't know how to get at the…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
6
votes
6 answers

Using libgit2sharp with LINQPad?

I have the LINQPad version with NuGet and I add libgit2sharp but this relies on a another (native) dll. I've tried: Copying them my systemdirectory. Put them in a separate directory that I've added to the path. Put them in LINQPads plugin…
Don
  • 9,511
  • 4
  • 26
  • 25
6
votes
1 answer

How can I use LinqPad's generated context in Visual Studio

This is a follow-on from this question really: Moving From LINQpad to a Proper Visual Studio Project? ..but I'm not able to get it to work properly. An answer to that question suggestions dumping the context assembly out as a dll but although I have…
Neil Trodden
  • 4,724
  • 6
  • 35
  • 55
6
votes
1 answer

How to get LINQPad to Dump() System.__ComObject references?

I am playing around with using LINQPad to rapidly develop small ArcObjects (a COM-based library for ESRI's ArcGIS software) applications and have had some success in using it to Dump() the properties of COM objects that I initialize from .NET, but…
blah238
  • 1,796
  • 2
  • 18
  • 51
6
votes
1 answer

creating DynamicDataContextDriver for linqpad with c#

I am trying to create driver for linqpad and have question: When I am creating DynamicDataContextDriver, I must create class TypedDataContext. What I should put in it? How will it be populated? Can I control how will it be populated? If I use…
andrey
  • 347
  • 3
  • 11
6
votes
2 answers

what is UserQuery in Linqpad?

Possible Duplicate: LINQPad error: ‘UserQuery’: cannot derive from sealed type ‘My.Entity.Framework.CustomDataContext’ i am running this query in LINQPad 4 with C# Expression as language from t in typeof(UserQuery).GetProperties() where t.Name ==…
NewbieFreak
  • 325
  • 1
  • 4
  • 13
6
votes
2 answers

Can I compare IL code to determine which technique is faster or better?

Background This question got me thinking about something. Lately, since I've been looking at linq pad's IL functionality, I've been comparing the IL code of two approaches to the same problem to "determine" which is best. Using the question linked…
Allen Rice
  • 19,068
  • 14
  • 83
  • 115
6
votes
3 answers

linqpad and custom IPrincipal serializable

I'm using LINQPad to test code (what a great product, I must say) but now I'm encountering an exception when I try to set the Thread.CurrentPrincipal to a custom IPrincipal that is marked with the SerializableAttribute following a sample that…
mCasamento
  • 1,413
  • 1
  • 11
  • 21
6
votes
1 answer

How to perform an ODATA expand in LinqPad

I'm using LINQPad to connect to the ODATA services on a local CRM organization and I don't know how to perform "joins" or to traverse relationships using LINQPad. Here is my…
Daryl
  • 18,592
  • 9
  • 78
  • 145
5
votes
2 answers

Modify "model" to add relationships in LinqPad?

I'm using LinqPad to query a MySQL MyISAM database. There are foreign keys, but no constraints on them, so LinqPad can't pick up the relationship. I'd like to add these relationships (tell it which fields are FKs) to make querying easier. Is this…
mpen
  • 272,448
  • 266
  • 850
  • 1,236
5
votes
3 answers

Insert data using LinqPad and Entity Framework

Is there a way to insert data using LinqPad and the entity framework? You need a "Context" of some kind to do an Add or AddObject. I can't find how to get that reference. I tried making one but then I go this error: ArgumentException: The…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
5
votes
1 answer

Why does .Dump(#) cause my results to double?

When I run an OData query with LinqPad, I sometimes need more than the standard 3 levels of nesting/expanding. I found online that you can call Dump(int nestingLevel) to get more levels of nesting. But when I do that I get two result sets. (One…
Vaccano
  • 78,325
  • 149
  • 468
  • 850
5
votes
1 answer

Can I Customize LinqPad shortcut keys?

I am accustomed to using ESC to "list members" and F1 to "show parameter info" in Visual Studio. This is an old habit from XCode. Is there any way to achieve this in LinqPad? I noticed an advanced preference called "use visual studio shortcut…
rocketsarefast
  • 4,072
  • 1
  • 24
  • 18
5
votes
3 answers

LINQPad: How do I add a property to each row being dumped?

In LINQPad, I frequently want to Dump some SQL table, but add a property to each row. I usually default to the simple: Publishers .Select(p => new { p, AppCount = p.Apps.Count() }) But of course this results in messy output, because each item is…
UnionP
  • 1,251
  • 13
  • 26
5
votes
3 answers

How to add (not replace) the content of a DumpContainer in LINQPad

I have a DumpContainer to which I'd like to add content dynamically. I know I can set the Content property to a new object but that gets rid of the previous content. How can I add instead of replace? Thanks for your help.
Yosef Bernal
  • 1,006
  • 9
  • 20