Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

Session.Save(Object) Method

Saves the specified persistent object to a data store.

Namespace: DevExpress.Xpo

Assembly: DevExpress.Xpo.v19.2.dll

Declaration

public void Save(
    object theObject
)

Parameters

Name Type Description
theObject Object

An object which represents the persistent object to save.

Remarks

Below is an example of using the Save method. Here, session is the Session instance.

Person personToUpdate = session.FindObject<Person>(CriteriaOperator.Parse("Name='Michael Suyama'"));
personToUpdate.Birthday = new DateTime(1986, 10, 31);
session.Save(personToUpdate);

The Save method also saves all the referenced objects that are aggregated (see the AggregatedAttribute topic for information) and any referenced newly created non-aggregated objects that don’t yet exist in the data store.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Save(Object) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also