My clients webshop allows saving of multiple shipping addresses per customer.
Now they want a customer account page listing the customer addresses with edit and delete buttons for every address.
The edit works fine, but when I try to delete an address I get following error. I think I'm not deleting it the correct way? Or is deleting an existing address not allowed for some reason?
deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: NHibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]
Delete address using code
Hey.
My clients webshop allows saving of multiple shipping addresses per customer.
Now they want a customer account page listing the customer addresses with edit and delete buttons for every address.
The edit works fine, but when I try to delete an address I get following error.
I think I'm not deleting it the correct way? Or is deleting an existing address not allowed for some reason?
deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: NHibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations)[UCommerce.EntitiesV2.Address#1149]
Thank you.
Kris.
Removing the address from the Customer first solved the problem :-)
CustomerService.Current().Addresses.Remove( uAddress );
uAddress.Delete();
Regards.
K.
is working on a reply...