Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1953a78

Browse files
committedDec 1, 2020
Fixes #2621
Special treatment of enums mapped on string columns because all reasons for checking string lengths or streamlining the length of parameters of queries on string columns to the length of the column for SQL Server are also valid for enums because they are sometimes by convention used to model the possible values of a string column
2 parents d383fcd + e8c8a3b commit 1953a78

File tree

1 file changed

+6
-8
lines changed
  • src/NHibernate.Test/NHSpecificTest/GH2621Enum

1 file changed

+6
-8
lines changed
 

‎src/NHibernate.Test/NHSpecificTest/GH2621Enum/Fixture.cs

+6-8
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,13 @@ public class Fixture : BugTestCase
77
[Test]
88
public void TestOk()
99
{
10-
using (ISession s = OpenSession())
10+
using (var s = OpenSession())
11+
using (s.BeginTransaction())
1112
{
12-
using (ITransaction t = s.BeginTransaction())
13-
{
14-
var query = s.CreateQuery(@"
15-
SELECT Name FROM NHibernate.Test.NHSpecificTest.GH2620Enum.ClassWithString ROOT WHERE ROOT.Kind = :kind");
16-
query.SetParameter("kind", Kind.SomeKind);
17-
Assert.DoesNotThrow(() => query.List());
18-
}
13+
var query = s.CreateQuery(
14+
@"SELECT Name FROM NHibernate.Test.NHSpecificTest.GH2621Enum.ClassWithString ROOT WHERE ROOT.Kind = :kind");
15+
query.SetParameter("kind", Kind.SomeKind);
16+
Assert.DoesNotThrow(() => query.List());
1917
}
2018
}
2119
}

0 commit comments

Comments
 (0)
Please sign in to comment.