Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/dotnetcore/SmartSql
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahoo-Wang committed Jul 26, 2019
2 parents 64e3d52 + bf7fa0a commit 952df62
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SmartSql/Middlewares/CommandExecuterMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ private void SetResultData<TResult>(object dbResult, SingleResultContext<TResult
var convertType = singleResult.ResultType;
convertType = Nullable.GetUnderlyingType(convertType) ?? convertType;

if (convertType.IsInstanceOfType(dbResult))
{
singleResult.SetData(dbResult);
return;
}

if (convertType.IsEnum)
{
singleResult.SetData(Enum.ToObject(convertType, dbResult));
Expand Down

0 comments on commit 952df62

Please sign in to comment.