Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

No commit message

  • Loading branch information...
commit 6f15765491e4b8c47668f11787d1373af38558c0 1 parent e11e88d
@Ivony authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Sources/Ivony.Data/EntityExtensions.cs
View
4 Sources/Ivony.Data/EntityExtensions.cs
@@ -50,7 +50,7 @@ public static T Entity<T>( this DbUtility dbUtility, IDbExpression expression )
/// <typeparam name="T">实体类型</typeparam>
/// <param name="dataItem">包含数据的 DataRow</param>
/// <returns>实体</returns>
- public static T ToEntity<T>( this DataRow dataItem ) where T : new()
+ public static T ToEntity<T>( this DataRow dataItem, IEntityConverter<T> converter = null ) where T : new()
{
if ( dataItem == null )
{
@@ -71,7 +71,7 @@ public static T ToEntity<T>( this DataRow dataItem ) where T : new()
}
- var convertType = ConvertTypeCache<T>.Converter;
+ var convertType = converter ?? ConvertTypeCache<T>.Converter;
if ( convertType == null )
{
Please sign in to comment.
Something went wrong with that request. Please try again.