-
If you create an entity called A and assign it to an entity called B, when saving B - entity A will be saved through
NestedPersistent - you can create an entity that is a property of another entity. Then when saving the main entity, the entity created as the property of it will be saved as well.
Example 1
CS
Person entity and then save the Person:
CS
Example 2
Below is the example of creating aContact entity, which is a property of another entity, such as Person.
CS
Contact entity are accessed through the instance of the Person entity as shown below. However, the statements may vary a little depending on the data type.
CS
Person entity with the use of the Save method the new Contact is also saved NestedPersistent).
When using the above type of code, the main entity (such as the
Person entity above) should also be created. When retrieving a person, it may already have a contact assigned to it. So therefore when adding values to the properties of the Contact in such an entity, what we would actually be doing is updating the existing Contact information.