MikaelEliasson / EntityFramework.Utilities

Provides extensions for EntityFramework that doesn't exist out of the box like delete and update by query and bulk inserts
443 stars 175 forks source link

EFBatchOperation Update - Incorrect syntax near the keyword 'IS' #52

Open titobf opened 9 years ago

titobf commented 9 years ago

I want to set an FK column to null.

EFBatchOperation.For(context, context.Table) .Where(a => a.FKColumn == id).Update(a => a.FKColumn , p => null);

Output:

UPDATE [dbo].[Table] SET [FKColumn] IS NULL WHERE [FKColumn] = @plinq0

Instead of "IS", it should output "=".

MikaelEliasson commented 9 years ago

There methods are a bit hacky. I need to consider if I should add an ugly fix or try to implement proper sql generation.