linqpad

Uri.EscapeUriString with square braces

让人想犯罪 __ 提交于 2019-12-10 03:34:07
问题 Something of a strange question but let's see what kind of response it gets... If I code a console app (VS 2013, .NET 4.5.1) and execute this line of code: Uri.EscapeUriString("[") I get this: [ However if I execute the same thing (well, technically Uri.EscapeUriString("[").Dump() ) in LINQPad on my machine I get this: %5B To further complicate things, according to this post Uri.EscapeUriString("[") should indeed return %5B .The post was written on 27/06/2012. I'm thinking that perhaps

Moving From LINQpad to a Proper Visual Studio Project?

♀尐吖头ヾ 提交于 2019-12-08 19:55:22
问题 I'm learning LINQ to SQL in LINQpad and it's been great, but there's a lot of magic happening under the hood that I don't quite understand. I am connecting to an Oracle database using the optional IQ driver that can be downloaded inside of LINQpad. I have my query working and now I need to move it into a new project within Visual Studio. Is it possible to use IQ within my solution in Visual Studio? I can't seem to find any information about using it outside of LINQpad. I've attempted to use

Is it possible to use LinqPad with a code-first model

ⅰ亾dé卋堺 提交于 2019-12-08 16:01:04
问题 In the past It's been easy to set a connection in LinqPad to a custom assembly that had EF model. Linqpad looks for a that is based on System.Data.Objects.ObjectContext which doesn't exist How (if at all) does one make their model assembly compatible with LinqPad.? 回答1: Right now, LINQPad does not support the EF CTP's code-first: there's a feature request here. It's almost certain that support will be added in the future - if this EF feature makes it past CTP (and maybe sooner with sufficient

Display progress while restoring database in linqpad with reative extensions

泄露秘密 提交于 2019-12-08 07:26:55
问题 I have the following C# code. var databaseRestore = new Microsoft.SqlServer.Management.Smo.Restore(); //databaseRestore.PercentComplete += CompletionStatusInPercent; //databaseRestore.PercentCompleteNotification = 10; //databaseRestore.Complete += Restore_Completed; ... var complete = Observable .FromEventPattern(databaseRestore, "Complete") .Select(x=>x.EventArgs as ServerMessageEventArgs) .Select(x=>x.Error.Message) .Take(1) .DumpLive("Complete"); var percentComplete = Observable

linqpad - SubmitChanges Extension

大城市里の小女人 提交于 2019-12-08 05:57:49
问题 Is it possible to get SubmitChanges() to work from within an extension method? I currently have this: void Main() { // Write code to test your extensions here. Press F5 to compile and run. Helper.ConfirmSubmitChanges(); } public static class Helper { // Write custom extension methods here. They will be available to all queries. public static void ConfirmSubmitChanges() { if (MessageBox.Show("Save?", "Do you really want to save all changes?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) =

Microsoft SQL Server accept blank in name of variables - Why?

萝らか妹 提交于 2019-12-08 05:02:56
问题 Microsoft SQL Server accept blank space in name of variables by usage of brackets: CREATE TABLE [dbo].[MyDataTable]( [Compo 1] [nvarchar](50) NULL, [Compo 2] [nvarchar](50) NULL, [Compo 3] [nvarchar](50) NULL, compo1 [nvarchar](50) NULL, compo2 [nvarchar](50) NULL, compo3 [nvarchar](50) NULL, compo_1 [nvarchar](50) NULL, compo_2 [nvarchar](50) NULL, compo_3 [nvarchar](50) NULL) Problem is what happens when a tool like entity framework or NHibernate or any other ORM tool or even manually I try

Using LINQPad to insert data into a SQL CE Database, Linq-to-sql, gets slower over time, anything I can do about it?

烈酒焚心 提交于 2019-12-08 00:15:24
问题 I have a SQL CE 4.0 database on disk, and a LINQPad program that I wanted to use to fill that database. I am using the built-in (to LINQPad) linq2sql system. I am noticing that as time goes on, the time it takes to insert a batch of rows takes more and more time and eventually it looks like the program has slowed to a crawl. Is there some kind of caching or similar that is slowing it down? What, if anything, can I do to avoid this slow-down? Here's my simple test-table that I used to test

在LINQPad中使用Ignite.NET

倾然丶 夕夏残阳落幕 提交于 2019-12-07 14:05:09
LINQPad 是进行.NET开发的一款优秀工具,非常有利于Ignite.NET API的快速入门。 入门 下载LINQPad: linqpad.net/Download.aspx ,注意要选择64位操作系统的 AnyCPU 版本; 安装Ignite.NET的NuGet软件包: 按F4(或点击 Query -> References 和 Properties 菜单项); 点击 Add NuGet… ,可能会出现警告: As you don't have LINQPad Premium/Developer Edition, you can only search for NuGet packages that include LINQPad samples. ,这是正常的,因为Ignite软件包确实包含LINQPad示例; 通过单击 Add To Query 按钮来安装软件包; 点击 Add namespaces 按钮,并(至少)添加第一个: Apache.Ignite.Core ; 关闭NuGet窗口,在 Query Properties 窗口上单击 OK ; 确认 Language 下拉框设置为 C# Expression (默认设置); 输入 Ignition.Start() ,然后按下F5。 Ignite节点启动后,就可以在输出面板中看到通常的控制台输出。 在左侧的

LINQPad 4 unable to find EntityFramework

和自甴很熟 提交于 2019-12-07 08:53:48
问题 I'm trying to use LINQPad 4 (the latest beta) with Entity Framework POCO classes. I take the normal path of creating a new connection and then selecting "Entity Framework DbContext POCO(4.1) and then selecting my he assembly holding my classes. When I do so I get the following message "Could not load file or assembly EntityFramework. Version=4.1.O.O, Culture= neutral, PublicKeyToken=b77a5c561934e089 or one of its dependencies. The system cannot find the file specified." I'm able to load the

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

做~自己de王妃 提交于 2019-12-07 03:01:06
问题 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 to above, about converting an array, I generated the IL code for the two answers: var arr = new string[] { "1", "2", "3", "4" }; var result = Array.ConvertAll(arr, s => Int32.Parse(s)); produced: IL_0001: ldc.i4.4 IL_0002: newarr System.String IL