Hi,
I think the return value (affected records) is now calculated differently for the SaveEntityCollection method.
I have inheritance, say, Base (mapped to table Base) and Inherited (mapped to Inherited table).
Direct and inherited properties of the Inherited entity instance are modified and then save is invoked. Return value is expected to be 1. Underneath it will have to do 2+ SQL queries of course. I was under assumption that affected records is the number of "entities" passed to the save method rather than the actual SQL records affected given the behaviour I've observed for years. However, after upgrading to 5.5 the method returns 2 instead of 1. It seems it can return 1 if Inherited entity instance properties are not modified.
Thus the question: is that a regression or... db count value is being returned directly now?
Thank you!
Following LinqPad snippet outputs 1 with 5.4.3 and 2 with 5.5. If direct property is commented out then prints 1 with 5.5.
void Main()
{
using (var ts = new System.Transactions.TransactionScope())
{
var pv = new XXXEntity(Guid.Parse("C72A7FA0-9672-4A31-A671-7D3571A5696D"));
pv.IsNew = false;
pv.Description = "1"; // inherited property
pv.DateUsableUntil = DateTimeOffset.UtcNow; // direct property
var c = new EntityCollection<XXXEntity>();
c.Add(pv);
this.AdapterToUse.SaveEntityCollection(c, false, false).Dump();
}
}