xpo-devexpress-dot-xpo-dot-xpbaseobject-dot-setmembervalue-x28-system-dot-string-system-dot-object-x29.md
Sets the value of the specified property.
Namespace : DevExpress.Xpo
Assembly : DevExpress.Xpo.v25.2.dll
NuGet Package : DevExpress.Xpo
public void SetMemberValue(
string propertyName,
object newValue
)
Public Sub SetMemberValue(
propertyName As String,
newValue As Object
)
| Name | Type | Description |
|---|---|---|
| propertyName | String |
A String value which specifies the property name. If a property with the specified name isn’t found, a InvalidPropertyPathException is thrown.
| | newValue | Object |
An object which represents the new value.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the SetMemberValue(String, 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.
XPO_how-to-persist-metadata-e269/CS/Program.cs#L93
XPBaseObject customer = (XPBaseObject)classCustomer.CreateNewObject(dataSession);
customer.SetMemberValue("FullName", "John Doe");
CriteriaOperatorsCheatSheet/CS/CriteriaOperatorCheatSheet/Program.cs#L59
theObject = (T)Activator.CreateInstance(typeof(T), new object[] { session });
((XPCustomObject)(object)theObject).SetMemberValue(propertyName, value);
}
XPO_how-to-define-a-persistent-class-at-runtime-e1139/CS/CreateClassAtRuntime/Program.cs#L31
XPBaseObject obj = (XPBaseObject)myClassA.CreateNewObject(session);
obj.SetMemberValue("Name", String.Format("sample {0}", DateTime.UtcNow.Ticks));
obj.Save();
user.IsActive = true;
user.SetMemberValue("Email", email);
user.SetPassword(password);
theObject = ObjectSpace.CreateObject<T>();
((XPBaseObject)(Object)theObject).SetMemberValue(propertyName, value);
}
XPO_how-to-persist-metadata-e269/VB/Program.vb#L83
Dim customer As XPBaseObject = CType(classCustomer.CreateNewObject(dataSession), XPBaseObject)
customer.SetMemberValue("FullName", "John Doe")
For i As Integer = 0 To OrderCount - 1
See Also