|
From: <fab...@us...> - 2010-07-22 05:36:21
|
Revision: 5038
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5038&view=rev
Author: fabiomaulo
Date: 2010-07-22 05:36:15 +0000 (Thu, 22 Jul 2010)
Log Message:
-----------
Refactor (for EnumType<T>)
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate/NHibernateUtil.cs
Modified: trunk/nhibernate/src/NHibernate/NHibernateUtil.cs
===================================================================
--- trunk/nhibernate/src/NHibernate/NHibernateUtil.cs 2010-07-22 04:57:07 UTC (rev 5037)
+++ trunk/nhibernate/src/NHibernate/NHibernateUtil.cs 2010-07-22 05:36:15 UTC (rev 5038)
@@ -51,7 +51,7 @@
/// <returns></returns>
public static IType GuessType(System.Type type)
{
- if(type.FullName.StartsWith(typeof(Nullable<>).FullName))
+ if(type.IsGenericType && typeof(Nullable<>).Equals(type.GetGenericTypeDefinition()))
{
type = type.GetGenericArguments()[0];
}
@@ -61,7 +61,7 @@
}
else if (type.IsEnum)
{
- return Enum(type);
+ return (IType) Activator.CreateInstance(typeof (EnumType<>).MakeGenericType(type));
}
else if (
typeof(IUserType).IsAssignableFrom(type) ||
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|