linqpad

How can I get the connection string for an SQL Express database listed in LINQPad?

浪尽此生 提交于 2019-12-21 12:07:28
问题 Is there an easy way to get the connection string of a database listed in the connection window of LINQPad (other than using the object explorer of Visual Studio)? 回答1: Making sgmoore's comment into an answer: try this.Connection.ConnectionString.Dump(); 回答2: In LinqPad 5 if your Language dropdown is set to C# Program and you have a database selected in the Connection dropdown, then you can get your string using string c = LINQPad.Util.CurrentDataContext.Connection.ConnectionString; 来源: https

How to use Visual Studio Team Services as a NuGet feed in LINQPad

旧街凉风 提交于 2019-12-21 04:59:22
问题 I am using LINQPad 5 and VSTS (visual studio team services) I have a NuGet feed (v3) in VSTS and I would like to use packages from there(private) in LINQPad I have tried using the personal access token from VSTS as the NuGet password in LINQPad I have tried putting the VSTS credential provider for nuget in AppData\Local\NuGet\CredentialProviders I have tried putting the VSTS credential provider for nuget in AppData\Local\LINQPad\NuGet\CredentialProviders I have tried using my VSTS username

Connect LINQPad to remote SQL Server

僤鯓⒐⒋嵵緔 提交于 2019-12-21 03:42:44
问题 Disclaimer: I understand the question is very basic, but I could not find the answer in Google or here, and can not do it myself with guessed configuration. I want to get started with LINQPad and I have a SQL Server 2005 installed on different machine in the same domain. But I can not connect to that server from LINQPad. Here is the screenshot: What do I put as a Server string? Many thanks in advance! Update 1: SERVERNAME\MSSQLSERVER does make a difference. Instead of Error 26 (Can not find

How to export data from LinqPAD as JSON?

泪湿孤枕 提交于 2019-12-21 03:41:16
问题 I want to create a JSON file for use as part of a simple web prototyping exercise. LinqPAD is perfect for accessing the data from my DB in just the shape I need, however I cannot get it out as JSON very easily. I don't really care what the schema is, because I can adapt my JavaScript to work with whatever is returned. Is this possible? 回答1: A more fluent solution is to add the following methods to the "My Extensions" File in Linqpad: public static String DumpJson<T>(this T obj) { return obj

Using WebAPI in LINQPad?

独自空忆成欢 提交于 2019-12-20 09:24:05
问题 When I tried to use the Selfhosted WebAPI in LINQPad, I just kept getting the same error that a controller for the class didn't exist. Do I have to create separate assemblies for the WebAPI (Controllers/Classes) and then reference them in my query? Here's the code I'm using #region namespaces using AttributeRouting; using AttributeRouting.Web.Http; using AttributeRouting.Web.Http.SelfHost; using System.Web.Http.SelfHost; using System.Web.Http.Routing; using System.Web.Http; #endregion public

Using WebAPI in LINQPad?

本小妞迷上赌 提交于 2019-12-20 09:21:42
问题 When I tried to use the Selfhosted WebAPI in LINQPad, I just kept getting the same error that a controller for the class didn't exist. Do I have to create separate assemblies for the WebAPI (Controllers/Classes) and then reference them in my query? Here's the code I'm using #region namespaces using AttributeRouting; using AttributeRouting.Web.Http; using AttributeRouting.Web.Http.SelfHost; using System.Web.Http.SelfHost; using System.Web.Http.Routing; using System.Web.Http; #endregion public

LINQPad error: 'UserQuery': cannot derive from sealed type 'My.Entity.Framework.CustomDataContext'

守給你的承諾、 提交于 2019-12-19 19:52:52
问题 LINQPad has suddenly started failing to run queries using an Entity Framework assembly. Everything seems to be in order, so I'm a bit confused why it's not working. My app works fine. The error is: 'UserQuery': cannot derive from sealed type 'My.Entity.Framework.CustomDataContext' Any ideas on how to get this working again? I can find no mention of this error online. 回答1: UserQuery is the type that contains your code in LinqPad. If you use a custom Entity Framework context from your own

How to generate the F# type signature similar to FSI in my own code?

主宰稳场 提交于 2019-12-18 15:09:30
问题 If one uses the F# Interactive Shell (FSI), the inferred expression type (signature) is printed to the console along with its value: val it : int * string * float = (42, "Hello F#", 42.0) How can I mimick the same behaviour in my own code, e.g. to get the inferred types as string for a F# expression? I don't need to dynamically evaluate any F# expressions, the expressions are known in compile time and are part of my (static) F# code. I need this feature to be able to mimick the FSI output in

How to debug LinqPad query in Visual Studio Debugger?

倾然丶 夕夏残阳落幕 提交于 2019-12-18 10:38:13
问题 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-( 回答1: If you call Debugger.Launch(); Debugger.Break(); to initiate the breakpoint within your LINQPad script, LINQPad will guess that you want to use VS to debug your script and won't delete the .cs file. 回答2: Start LINQPad In VS, open Debug -> Attach to Process... Choose LINQPad.exe Set breakpoint in your code called by LINQPad C# code, or write

LINQ to Entities not returning expected result

风格不统一 提交于 2019-12-18 09:13:17
问题 I am using a view to return a complex search query. When I usin linq to query against EF it is returning the same row 3 times(the actual rowcount is correct). using LinqPad I have run the same linq against my ef entity and the actual database view. ReadmitPatientList .AsQueryable() .Where("PatientLastName.StartsWith(\"cooper\")") .OrderBy (rpl => rpl.PatientLastName) .Dump(); That is the linq I am using for both. linqpad shows the lambda as this: EF: ReadmitPatientList.MergeAs (AppendOnly)