Permalink
Browse files

No commit message

  • Loading branch information...
Ivony committed Oct 25, 2012
1 parent 0e0b1df commit 11e5feb1d9100d0c214f53442ab4a00355958930
@@ -52,6 +52,15 @@ public static T Entity<T>( this DbUtility dbUtility, IDbExpression expression )
/// <returns>实体</returns>
public static T ToEntity<T>( this DataRow dataItem ) where T : new()
{
+ if ( dataItem == null )
+ {
+
+ if ( typeof( T ).IsValueType )
+ throw new ArgumentNullException( "dataItem" );
+
+ else
+ return default( T );//等同于return null
+ }
if ( dataItem.Table.Columns.Count == 1 )
{
Oops, something went wrong.

0 comments on commit 11e5feb

Please sign in to comment.