Walaa wrote:
Please don't use AddNew() it's for databinding code only as the reference manual says.
I tried to do it also like this:
// adding of new entities
PriceEntity price = new PriceEntity();
_priceList.Price.Add(price);
Later in my code, i removed some newly added entites like this:
if(price.IsNew) // business rule doesn't allow removing already persisted price items
_priceList.Price.Remove(price);
After the removal, debuger shows that _priceList.Price.Count is correct.
Now i tried to persist the _priceList object like this:
adapter.SaveEntity(_priceList);
All new entities that i added end up inserted in DB. How is that possible if i detached them with Remove() method and Count value is correct? Where are these removed entities hidden and why are they inserted into DB?
thanx,
daniel