Skip to content

Commit 34b156b

Browse files
committed
Refactoring: reused one Get method in the another in Int32Type
1 parent 1605507 commit 34b156b

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/NHibernate/Type/Int32Type.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,7 @@ public override object Get(DbDataReader rs, int index, ISessionImplementor sessi
4747

4848
public override object Get(DbDataReader rs, string name, ISessionImplementor session)
4949
{
50-
try
51-
{
52-
return rs[name] switch
53-
{
54-
BigInteger bi => (int) bi,
55-
var c => Convert.ToInt32(c)
56-
};
57-
}
58-
catch (Exception ex)
59-
{
60-
throw new FormatException(string.Format("Input string '{0}' was not in the correct format.", rs[name]), ex);
61-
}
50+
return Get(rs, rs.GetOrdinal(name), session);
6251
}
6352

6453
public override System.Type ReturnedClass

0 commit comments

Comments
 (0)