Question

What is the opposite of:

Dim ad As New Address
Person.AddressReference.Attach(ad)

I mean how do I delete the Person.Address? (both with deleting and without - meaning only delete the relation)?

Was it helpful?

Solution

I don't do VB, so forgive me if my syntax isn't quite right.

To "attach":

Person.Address = ad

To "detach"

Person.Address = Nothing

If you want to delete, then do:

Context.DeleteObject(ad)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top