I have the following code:
Guid id = imageMetaData.ID;
Data.LinqToSQL.Image dbImage = DBContext.Images.Where(x => x.ID == id).SingleOrDefault();
dbImage.width = imageMetaData.Width;
dbImage.height = imageMetaData.Height;
DBContext.SubmitChanges();
Looking at SQL Profiler, the following SQL is being generated:
exec sp_executesql N'UPDATE [dbo].[Images]
SET [height] = @p0, [width] = @p1
WHERE 0 = 1',N'@p0 int,@p1 int',@p0=603,@p1=365
Why does my where statement not include a "where id=...."???
What am I doing wrong?
My application throws a ChangeConflictException with the message... "Row not found or changed"