I am experiencing an issue with how LinqConnect translates Linq queries to SQL. For example the following code is translated like this.
Code: Select all
from server in context.Server
where server.Name == serverName
select server;
Code: Select all
(@p0 nvarchar(12))SELECT [t1].[name], [t1].[description], [t1].[serverid]
FROM [dbo].[server] [t1]
WHERE [t1].[name] = @p0
The problem is that the serverName parameter is translated to a nvarchar while the column is a varchar which causes the query to perform unnecessary conversions.
This stack overflow post demonstrates a method to reactively adjust the DbType of the query's parameters. I have been unable to find a way to pro-actively change these occurrences. Is it possible to influence the translation mechanics to alleviate this?
LinqConnect version 4.1.184.0