Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 84751

Object.RelatedObject.Remove - not working?

$
0
0
Hi Marko ,
Thank you for getting back to us.

If the associations for the both entities have the IsManaged() set, the runtime would actually try to set the associated field to NULL when it is removed  from the collection and this will throw an exception if the field is not nullable.
If IsManaged() is not set for the associations, then the database will not be affected at all. This also applies for the insert statements, as the key property will not be set in this case.
In order to remove an entity from the database, you should always make sure to use the Delete() method of the context, regardless if the IsManaged() is set or not.

I hope this information is helpful.

Regards,
Yavor Slavchev
Telerik
 
Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.

Viewing all articles
Browse latest Browse all 84751

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>