Skip to content

Commit

Permalink
Merge pull request #1623 from Zinoberous/master
Browse files Browse the repository at this point in the history
Fixex GetPropertyUnambiguous and default value comparison for issue 1622
  • Loading branch information
borisdj authored Nov 28, 2024
2 parents fb12d0e + 5af41f2 commit e7053e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EFCore.BulkExtensions.Core/TableInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ void AddOwnedType(INavigation navigationProperty, string prefix = "")

while (type != null)
{
var property = type.GetProperty(name, BindingFlags.DeclaredOnly);
var property = type.GetProperty(name, BindingFlags.DeclaredOnly | BindingFlags.Public | BindingFlags.Instance);

if (property != null)
{
Expand Down
2 changes: 1 addition & 1 deletion EFCore.BulkExtensions.Core/Util/GenericsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal static IEnumerable<string> GetPropertiesDefaultValue<T>(this T value, T
if (!type.IsInterface && hasParameterlessConstructor)
defaultValue = field.GetValue(Activator.CreateInstance(type, true));

if (temp == defaultValue ||
if (temp?.ToString() == defaultValue?.ToString() ||
(temp != null && defaultValue != null &&
temp.ToString() == "0" && defaultValue.ToString() == "0") || // situation for int/long prop with HasSequence (test DefaultValues: Document)
(temp is Guid guid && guid == Guid.Empty))
Expand Down

0 comments on commit e7053e1

Please sign in to comment.