You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems, that PropertiesToIncludeOnUpdate is gnored when using with MySQL.
The effect is, that all properties are updated in the DB which either leads the foreign keys be deleted due to null-values (in the case of nullable columns) or to an exception, because the constrained is violated due to no element with ID '0' being available (in the case of non nullable FKs).
Of course normal properties will be overwritten with their respective default values too.
All other similar options (i.e. PropertiesToExclude, PropertiesToExcludeOnUpdate, PropertiesToInclude, PropertiesToIncludeOnUpdate) seem to have the same behavior.
PropertiesToIncludeOnUpdate works as expected with MS-SQL, where only properties specified in the options will be updated in the DB.
I expected to PropertiesToIncludeOnUpdate either exclude/include certain properties when updating entities
or to have the same behavior across all DB implementations.
The text was updated successfully, but these errors were encountered:
The method MergeTable seems to build the SQL-command that we observed while debugging our code.
The behavior of the GetColumnList method changed a little bit with the switch from OperationType.Insert to OperationType.InsertOrUpdate - not sure what that did exactly to its result.
But I think the behavior did not change to - somehow - replace the behavior of the different dictionary in the Where clause.
So it it seems, the change of the columns dictionary in the where-clause would explain the issue.
Likewise I guess the issue would be solved when changing the Where-line back.
It seems, that
PropertiesToIncludeOnUpdate
is gnored when using with MySQL.The effect is, that all properties are updated in the DB which either leads the foreign keys be deleted due to null-values (in the case of nullable columns) or to an exception, because the constrained is violated due to no element with ID '0' being available (in the case of non nullable FKs).
Of course normal properties will be overwritten with their respective default values too.
All other similar options (i.e.
PropertiesToExclude
,PropertiesToExcludeOnUpdate
,PropertiesToInclude
,PropertiesToIncludeOnUpdate
) seem to have the same behavior.PropertiesToIncludeOnUpdate
works as expected with MS-SQL, where only properties specified in the options will be updated in the DB.I have set up an example test project available here:
https://github.com/ErikForwerk/BulkExtensionsUpdateBugExample
(see README.md for some explanation to the project, but it is fairly small straight forward)
I expected to
PropertiesToIncludeOnUpdate
either exclude/include certain properties when updating entitiesor to have the same behavior across all DB implementations.
The text was updated successfully, but these errors were encountered: