Skip to content

Commit e7053e1

Browse files
authored
Merge pull request #1623 from Zinoberous/master
Fixex GetPropertyUnambiguous and default value comparison for issue 1622
2 parents fb12d0e + 5af41f2 commit e7053e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

EFCore.BulkExtensions.Core/TableInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ void AddOwnedType(INavigation navigationProperty, string prefix = "")
706706

707707
while (type != null)
708708
{
709-
var property = type.GetProperty(name, BindingFlags.DeclaredOnly);
709+
var property = type.GetProperty(name, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance);
710710

711711
if (property != null)
712712
{

EFCore.BulkExtensions.Core/Util/GenericsHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ internal static IEnumerable<string> GetPropertiesDefaultValue<T>(this T value, T
3636
if (!type.IsInterface && hasParameterlessConstructor)
3737
defaultValue = field.GetValue(Activator.CreateInstance(type, true));
3838

39-
if (temp == defaultValue ||
39+
if (temp?.ToString() == defaultValue?.ToString() ||
4040
(temp != null && defaultValue != null &&
4141
temp.ToString() == "0" && defaultValue.ToString() == "0") || // situation for int/long prop with HasSequence (test DefaultValues: Document)
4242
(temp is Guid guid && guid == Guid.Empty))

0 commit comments

Comments
 (0)