PropertyValues.SetValues Method

Definition

Overloads

SetValues(PropertyValues)

Sets the values of this object by reading values from another PropertyValues object.

SetValues(IDictionary<String,Object>)

Sets the values of this object by copying values from the given dictionary.

The keys of the dictionary must match property names. Any key in the dictionary that does not match the name of a property in the entity type will be ignored.

SetValues(Object)

Sets the values of this object by copying values from the given object.

SetValues<TProperty>(IDictionary<String,TProperty>)

Sets the values of this object by copying values from the given dictionary.

SetValues(PropertyValues)

Sets the values of this object by reading values from another PropertyValues object.

public abstract void SetValues (Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues propertyValues);
abstract member SetValues : Microsoft.EntityFrameworkCore.ChangeTracking.PropertyValues -> unit
Public MustOverride Sub SetValues (propertyValues As PropertyValues)

Parameters

propertyValues
PropertyValues

The object from which values should be copied.

Remarks

The other object must be based on the same type as this object, or a type derived from the type for this object.

See Accessing tracked entities in EF Core for more information and examples.

Applies to

SetValues(IDictionary<String,Object>)

Sets the values of this object by copying values from the given dictionary.

The keys of the dictionary must match property names. Any key in the dictionary that does not match the name of a property in the entity type will be ignored.

public virtual void SetValues (System.Collections.Generic.IDictionary<string,object> values);
abstract member SetValues : System.Collections.Generic.IDictionary<string, obj> -> unit
override this.SetValues : System.Collections.Generic.IDictionary<string, obj> -> unit
Public Overridable Sub SetValues (values As IDictionary(Of String, Object))

Parameters

values
IDictionary<String,Object>

The dictionary to read values from.

Applies to

SetValues(Object)

Sets the values of this object by copying values from the given object.

public abstract void SetValues (object obj);
abstract member SetValues : obj -> unit
Public MustOverride Sub SetValues (obj As Object)

Parameters

obj
Object

The object to read values from.

Remarks

The given object can be of any type. Any property on the object with a name that matches a property name in the entity type and can be read will be copied. Other properties will be ignored. This allows, for example, copying of properties from simple Data Transfer Objects (DTOs).

See Accessing tracked entities in EF Core for more information and examples.

Applies to

SetValues<TProperty>(IDictionary<String,TProperty>)

Sets the values of this object by copying values from the given dictionary.

public virtual void SetValues<TProperty> (System.Collections.Generic.IDictionary<string,TProperty> values);
abstract member SetValues : System.Collections.Generic.IDictionary<string, 'Property> -> unit
override this.SetValues : System.Collections.Generic.IDictionary<string, 'Property> -> unit
Public Overridable Sub SetValues(Of TProperty) (values As IDictionary(Of String, TProperty))

Type Parameters

TProperty

Parameters

values
IDictionary<String,TProperty>

The dictionary to read values from.

Remarks

The keys of the dictionary must match property names. Any key in the dictionary that does not match the name of a property in the entity type will be ignored.

See Accessing tracked entities in EF Core for more information and examples.

Applies to