linqpad

LinqPad adds an S to the end of every table

穿精又带淫゛_ 提交于 2019-12-06 23:41:23
问题 I have just downloaded LinqPad to explore the benefits of using Linq queries in an application I am working on, however when I look at my database tables in the column on the left LinqPad displays all my tables with an 's' on the end, for instance CategoryTbl becomes CategoryTbls yet when I view my database in SQL management studio the table names appear correct. Though any tables that should have an S on the end ie clients remain unchanged. When I execute a Linq query I have to execute it

LINQPad and Oracle

守給你的承諾、 提交于 2019-12-06 18:31:39
问题 Does LINQPad work with Oracle? Has anyone tried? What do you suggest? 回答1: Judging by their user voice item request for Oracle support, it appears unsupported at the moment. A comment on the O'Reilly forums also suggests its not supported. update As we understand it, there's now built-in Oracle support in the latest versions of LinqPad; the home page of LinqPad now lists support for Oracle. update January 2013 The new LinqPad-to-Oracle support appears to still be available. Per the LinqPad

JToken is not a reference of JObject?

匆匆过客 提交于 2019-12-06 10:07:22
问题 I have not yet noticed that James Newton King wrote or spoke about what JToken is . I have made the incorrect assumption that it somehow holds a reference to JObject . This is not the case as the these LINQPad statements demonstrate: var json = @" { ""item"": { ""foo"": ""4"", ""bar"": ""42"" } } "; var jO = JObject.Parse(json); var jToken = jO["item"]["foo"]; jToken = "5"; jO.ToString().Dump("jO"); jToken.Dump("jToken"); The output: jO { "item": { "foo": "4", "bar": "42" } } jToken 5 Should

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-06 05:56:41
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 this with: CREATE TABLE dummy ( id int not null primary key identity (1, 1), value nvarchar(20) not null )

Sort by New Guid for random order

浪尽此生 提交于 2019-12-05 14:47:10
In order to get results in a random order from a Sql query I generally sort by new Guids. I have done this before with Entity-Framework, however for some reason its not working now. For example (using the adventureworks2008r2 database) i run the following query in LinqPad: (from t in Employees orderby Guid.NewGuid() select new {t.Person.FirstName,t.Person.LastName,t.JobTitle}) This generates the following SQL: SELECT [t1].[FirstName], [t1].[LastName], [t0].[JobTitle] FROM [HumanResources].[Employee] AS [t0] INNER JOIN [Person].[Person] AS [t1] ON [t1].[BusinessEntityID] = [t0].

LINQPad 4 unable to find EntityFramework

北慕城南 提交于 2019-12-05 13:19:22
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 assembly from my application just fine. What gives? It seems a bit different from the previous problem

What state is saved between rerunning queries in Linqpad?

怎甘沉沦 提交于 2019-12-05 10:36:52
What state is saved between rerunning queries in Linqpad? I presumed none, so if you run a script twice it will have the same results both time. However run the C# Program below twice in the same Linqpad tab. You'll find the first it prints an empty list, the second time a list with the message 'hey'. What's going on? System.ComponentModel.TypeDescriptor.GetAttributes(typeof(String)).OfType<ObsoleteAttribute>().Dump(); System.ComponentModel.TypeDescriptor.AddAttributes(typeof(String),new ObsoleteAttribute("hey")); LINQPad caches the application domain between queries, unless you request

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

[亡魂溺海] 提交于 2019-12-05 08:19:17
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_0007: stloc.2 IL_0008: ldloc.2 IL_0009: ldc.i4.0 IL_000A: ldstr "1" IL_000F: stelem.ref IL_0010: ldloc.2

LinqPad adds an S to the end of every table

旧时模样 提交于 2019-12-05 03:27:51
I have just downloaded LinqPad to explore the benefits of using Linq queries in an application I am working on, however when I look at my database tables in the column on the left LinqPad displays all my tables with an 's' on the end, for instance CategoryTbl becomes CategoryTbls yet when I view my database in SQL management studio the table names appear correct. Though any tables that should have an S on the end ie clients remain unchanged. When I execute a Linq query I have to execute it against CategoryTbls but a SQL query has to be executed against CategoryTbl. I was just wondering why

Uri.EscapeUriString with square braces

橙三吉。 提交于 2019-12-05 03:12:44
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 LINQPad is referencing an older DLL than that used by VS, but that would imply that EscapeUriString has