When updating a nullable field EFU generates wrong code.
Example:
================== Generated SQL ====================
UPDATE [dbo].[customer]
SET [legalAddressId] = @plinq0 OR ([legalAddressId] IS NULL)
WHERE ([legalAddressId] IN
(cast('3c966889-4e55-44f3-b939-69e89f599e62' as uniqueidentifier))) AND ([legalAddressId] IS NOT NULL)
================== End Generated SQL ====================
================== Field Declaration ====================
[legalAddressId] UNIQEUIDENTIFIER NULL
================== End Field Declaration ====================
When updating a nullable field EFU generates wrong code.
Example: ================== Generated SQL ==================== UPDATE [dbo].[customer] SET [legalAddressId] = @plinq0 OR ([legalAddressId] IS NULL) WHERE ([legalAddressId] IN (cast('3c966889-4e55-44f3-b939-69e89f599e62' as uniqueidentifier))) AND ([legalAddressId] IS NOT NULL) ================== End Generated SQL ====================
================== Field Declaration ==================== [legalAddressId] UNIQEUIDENTIFIER NULL ================== End Field Declaration ====================
================== C# Source Code ==================== Guid? firstId; List<Guid?> idsToDelete; ... EFBatchOperation .For(dataEntity, dataEntity.customer) .Where(a => idsToDelete.Contains(a.legalAddressId)) .Update(a => a.legalAddressId, b => firstId); ================== End C# Source Code ====================