코드 테이블에 char (4) 유형의 열이 있습니다.linq의 매개 변수 유형을 char (*) 유형에 대한 nhibernate 쿼리로 설정하는 방법은 무엇입니까?
Person 테이블은 다음과 같습니다
사람 HBM은 다음과 같습니다 SQL 쿼리의
SessionInstance.Query<Person>()
.Where(x => x.Code == "1234")
.Select(x => x.Code)
.ToList();
그러나 추적 :
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Domain" namespace="Domain.Model">
<class name="Person" table="Person">
<property name="Code" >
<column name="Code" **sql-type="char(4)"**/>
</property>
...
</class>
</hibernate-mapping>
지금 내가 NHibernate에 쿼리 LINQ를 프로파일 러가 필요하지 않습니다.
exec sp_executesql N'select person_.Code as col_0_0_ from Person person_ where [email protected]',N'@p0 nvarchar(4000)',@p0=N'1234'
@p0
의 유형 char(4)
및 @p0
의 값이 N'1234'
대신 '1234'
원인이 무엇입니까?