Search
-
Re: BUG? Preprocessor directive LINQPAD
-
BUG: Ineligible autocomplete entries (generic extension methods with constraints)
I have some extensions defined to help with chaining expressions with common interfaces and operations. public static class ChainableExtensions{ public static T With<T>(this T source, Action<T> action) { action(source); return source; } public static TResult Let<T, TResult>(this T source, Func<T, TResult> func) { return… -
LP 7 EF Core Context wrong precision
Hello, I use LINQPad 7.3.9 with an Entity Framework Core 6.0.3 context. My table has a column (numeric 6,4) which I need to update. But the created SQL parameter uses the default precision 18, 2: -- Region Parameters -- @p1='1591', @p0='1.0258' (Precision = 18) (Scale = 2) -- EndRegion Therefore the value gets rounded. Is… -
Re: Avoiding bloated and contested MyExtensions. Thoughts?
@Tormod This might help, if you make MyExtensions partial, it makes it very easy to remove, and add sections of functionality to it. #region MyExtension public static partial class MyExtensions { public static string Stuff1; } #endregion MyExtension #region OtherExtension public static partial class MyExtensions { public… -
Re: Missing preprocessor symbols for Net Version
In LINQPad, the symbol is just NET6 - this is equivalent to NET6_0_OR_GREATER The default My Extensions query text should contain the following: #region Advanced - How to multi-target// The NET6 symbol is active when the query runs on .NET 6 or later.#if NET6// Code that requires .NET 6 or later#endif#if NET5// Code that… -
Can I get more than 1000 characters in the parameters section of the SQL output pane?
I have been using LINQPad to deploy a few large strings directly into a database table, but I recently needed to get the full script of what was being generated so I could deploy in an environment without LINQPad. When I opened the SQL output pane, the declaration which held the variable containing my 9 KB string was… -
LINQ to SQL "Single" optimization
I've noticed that, when using a LINQ to SQL data context, doing a TableName.Single(x => x.Test == 1000) for example, the SQL query that is executed is:-- Region Parameters DECLARE @p0 Int = 1000 -- EndRegion SELECT [t0].[ID], [t0].[Test] FROM [TableName] AS [t0] WHERE [t0].[Test] = @p0 which can be very inefficient - I… -
Re: Accesing stored procedure value using output parameter
KeyNotFoundException - the given key was not present in the dictionary. It also complained that I needed to place the expected KeyID arg in the calling parameters. So I had to write it thusly: int Key = 0; Key = (int)GetNextID(Tname, Key).OutputParameters["KeyID"]; This is the SQL generated (looks ok to me) -- Region… -
SQL generated by Linq doesn't include the parameter values (SQL tab)
When running a linq query that contains parameters, the generated query doesn't show the parameter values used. This Linq var x = Guid.Parse("a34e9117-c95e-4b96-8fa0-0002016d915c"); var tasks = Tasks.IgnoreQueryFilters().Where(t=> t.Id == x).Select(t => t.Id).Dump(); Generates this SQL: -- Region Parameters -- @__x_0='?'… -
Re: Parameters disappearing
First, check whether you use the correct boolean operators (google bitwise versus logical for explanation of difference between & and &&, and | and ||). If you want to keep the boolean parameter (keep LINQ-to-SQL from optimizing the expression tree), you can use a compiled query. E.g.int batchId = 10190; var query =… -
Re: How to set up log4net?
I'm not getting any errors, but I'm not getting any output either. So, I'm sure that I'm doing something wrong or missing a step. This is what I did in my program: LogHelper Class#region LogHelper class class LogHelper { public static log4net.ILog GetLogger(string fileName = @"c:\temp\test.log") =>… -
Unexpected behaviour in Premium editing grid - possible bug?
Using v4.47.02(Any CPU). When adding a new row in a SQL Server table using the editing grid, I noticed that if a non-nullable char(1) field has a default value of 'N' then the editing grid will automatically insert a single space value if a specific value is not entered for that field. I would have expected it to either… -
[BUG] IQ Driver Generates Bad SQL and returns wrong results
Version: 5.05.02(AnyCPU) IQ Driver: 2.1.2.0 Database: MemSQL 4.1.3 I believe I found a bug where the IQ driver is generating bad SQL and returning an incorrect result set. Here's the C# querying a table called Creatives that has a column on ID: Creatives .Take(10) .Select(c => c.Id % 2 == 1) .GroupBy(c => c) .Select(c =>…