src/Shared/EntityFramework/Internal/EntityEntries/InternalPropertyEntry.cs
// <summary>
// Sets the property value, potentially by setting individual nested values for a complex
// property.
// </summary>
// <param name="value"> The value. </param>
Sets the property value, potentially by setting individual nested values for a complex
property.
Sets the property value potentially by setting individual nested values for a complex property .
private void SetPropertyValueUsingValues(InternalPropertyValues internalValues, object value)
        {
            DebugCheck.NotNull(internalValues);
            var nestedValues = internalValues[Name] as InternalPropertyValues;
            if (nestedValues != null)
            {
                Debug.Assert(value != null, "Should already have thrown if complex object is null.");
                if (!nestedValues.ObjectType.IsAssignableFrom(value.GetType()))
                {
                    throw Error.DbPropertyValues_AttemptToSetValuesFromWrongObject(
                        value.GetType().Name, nestedValues.ObjectType.Name);
                }
                nestedValues.SetValues(value);
            }
            else
            {
                internalValues[Name] = value;
            }
        }
private void SetPropertyValueUsingValues ( InternalPropertyValues internalValues , object value ) { DebugCheck . NotNull ( internalValues ) ; var nestedValues = internalValues [ Name ] as InternalPropertyValues ; if ( nestedValues != null ) { Debug . Assert ( value != null , " " ) ; if ( ! nestedValues . ObjectType . IsAssignableFrom ( value . GetType ( ) ) ) { throw Error . DbPropertyValues_AttemptToSetValuesFromWrongObject ( value . GetType ( ) . Name , nestedValues . ObjectType . Name ) ; } nestedValues . SetValues ( value ) ; } else { internalValues [ Name ] = value ; } }
Sets the property value, potentially by setting individual nested values for a complex
property.
Sets the property value potentially by setting individual nested values for a complex property .
// Setting values from a derived type is allowed, but setting values from a base type is not.
internalValues
InternalPropertyValues
value
object
None