I want to force all the entities in a collection to be dirty and new and then have 1 PK (has multiple PKs) field set specific to a new value
So I do this:
foreach (E entity in Collection)
{
entity.IsNew = true;
entity.IsDirty = true;
entity.SetNewFieldValue("ABC", MyABCVal);
}
The SQL generated only does an Insert for the ABC field, ingnoring the rest of the fields
Query: INSERT INTO [xxx].[dbo].[tb_xxx] ([ABC]) VALUES (@ABC)
Parameter: @ABC : Byte. Length: 1. Precision: 3. Scale: 0. Direction: Input. Value: 1.