I changed an entity to use a complex type (editing the edmx in XML). I can retrieve and bind data without issue. I can insert a new entity (which also binds correctly) and it persists to the database correctly. I can delete rows in a child collection without a problem. Only UPDATE isn't working. I see (in SQL Profiler) that it generates update SQL but fails to include the actual columns that were changed (it only has a test for the timestamp column and sets a variable that it declares; the "@p" in the sql shown below). If I also modify a column that is just a scalar property, that column gets updated but not any columns in the complex type.
Here's the UPDATE SQL that was generated:
exec sp_executesql N'declare @p int
update [dbo].[myTable]
set @p = 0
where (([myKeyColumn] = @0) and ([timestamp] = @1))
select [timestamp]
from [dbo].[myTable]
where @@ROWCOUNT > 0 and [myKeyColumn] = @0',N'@0 int,@1 binary(8)',@0=9367,@1=0x000000000204D184
I was able to modify the entity prior to switching to complex types without any issue.
Any thoughts?