Skip to content

Commit

Permalink
tmsmith#282 Fixed member type validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardo.matias committed Feb 6, 2024
1 parent ae74414 commit 47977b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DapperExtensions/DapperImplementor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ protected virtual DynamicParameters AddParameter<T>(T entity, DynamicParameters

parameters ??= new DynamicParameters();

if (prop.MemberInfo.DeclaringType == typeof(bool) || (prop.MemberInfo.DeclaringType.IsGenericType && prop.MemberType.GetGenericTypeDefinition() == typeof(Nullable<>) && prop.MemberInfo.DeclaringType.GetGenericArguments()[0] == typeof(bool)))
if (prop.MemberInfo.DeclaringType == typeof(bool) || (prop.MemberInfo.DeclaringType.IsGenericType && prop.MemberType.IsGenericType && prop.MemberType.GetGenericTypeDefinition() == typeof(Nullable<>) && prop.MemberInfo.DeclaringType.GetGenericArguments()[0] == typeof(bool)))
{
var value = (bool?)propValue;
if (!value.HasValue)
Expand Down

0 comments on commit 47977b0

Please sign in to comment.