New to both NHibernate and Fluent NHibernate and I'm trying to resolve a performance problem in some inherited code caused by a conversion of a CHAR(10) column to NVARCHAR.
From SQL Profiler:
exec sp_executesql N'select mytestclas0_.LinkId as LinkId45_,
mytestclas0_.Href as Href45_,
mytestclas0_.LinkActive as LinkActive45_
from MessageLinks mytestclas0_
where mytestclas0_.LinkId=@p0',N'@p0 nvarchar(4000)',@p0=N'BzE2T48HMF'
Run Code Online (Sandbox Code Playgroud)
您可以看到来自NHibernate的ID被转换为NVARCHAR.
表定义:
CREATE TABLE [dbo].[MyTable](
[ID] [int] NULL,
[Href] [nvarchar](1000) NULL,
[LinkActive] [bit] NOT NULL,
[LinkId] [char](10) NOT NULL
)
Run Code Online (Sandbox Code Playgroud)
类文件:
public class MyTestClass {
public MyTestClass() …Run Code Online (Sandbox Code Playgroud)