Dapper-Extensions icon indicating copy to clipboard operation
Dapper-Extensions copied to clipboard

fix DapperExtensions.Get will occur exception when parameter id is no…

Open noneiori opened this issue 2 years ago • 0 comments

…t a KeyValuePair (issue #315)

Hi,

According to get-operation,it will get a sinlge object, but I get a exception because wherePredicate this variable return a empty IPredicate,

foreach (var kvp in ReflectionHelper.GetObjectValues(entity).Where(property => notIgnoredColumns.Any(c => c.Name == property.Key)))

And it will fetch whole data while a empty IPredicate,so it would better to add a IPredicate when predicates is empty.

Thank you.

noneiori avatar Jul 16 '23 00:07 noneiori