src/Shared/EntityFramework/Core/Mapping/Update/Internal/ExtractorMetadata.cs
// <summary>
// Converts a record to a propagator result
// </summary>
// <param name="stateEntry"> state manager entry containing the record </param>
// <param name="isModified"> Indicates whether the root element is modified (i.e., whether the type has changed) </param>
// <param name="record"> Record to convert </param>
// <param name="useCurrentValues"> Indicates whether we are retrieving current or original values. </param>
// <param name="translator"> Translator for session context; registers new metadata for the record type if none exists </param>
// <param name="modifiedPropertiesBehavior"> Indicates how to determine whether a property is modified. </param>
// <returns> Result corresponding to the given record </returns>
Converts a record to a propagator result
Converts a record to a propagator result
internal static PropagatorResult ExtractResultFromRecord(
            IEntityStateEntry stateEntry, bool isModified, IExtendedDataRecord record,
            bool useCurrentValues, UpdateTranslator translator, ModifiedPropertiesBehavior modifiedPropertiesBehavior)
        {
            var structuralType = (StructuralType)record.DataRecordInfo.RecordType.EdmType;
            var metadata = translator.GetExtractorMetadata(stateEntry.EntitySet, structuralType);
            var key = stateEntry.EntityKey;
            var nestedValues = new PropagatorResult[record.FieldCount];
            for (var ordinal = 0; ordinal < nestedValues.Length; ordinal++)
            {
                nestedValues[ordinal] = metadata.RetrieveMember(
                    stateEntry, record, useCurrentValues, key,
                    ordinal, modifiedPropertiesBehavior);
            }
            return PropagatorResult.CreateStructuralValue(nestedValues, structuralType, isModified);
        }
internal static PropagatorResult ExtractResultFromRecord ( IEntityStateEntry stateEntry , bool isModified , IExtendedDataRecord record , bool useCurrentValues , UpdateTranslator translator , ModifiedPropertiesBehavior modifiedPropertiesBehavior ) { var structuralType = ( StructuralType ) record . DataRecordInfo . RecordType . EdmType ; var metadata = translator . GetExtractorMetadata ( stateEntry . EntitySet , structuralType ) ; var key = stateEntry . EntityKey ; var nestedValues = new PropagatorResult [ record . FieldCount ] ; for ( var ordinal = 0 ; ordinal < nestedValues . Length ; ordinal ++ ) { nestedValues [ ordinal ] = metadata . RetrieveMember ( stateEntry , record , useCurrentValues , key , ordinal , modifiedPropertiesBehavior ) ; } return PropagatorResult . CreateStructuralValue ( nestedValues , structuralType , isModified ) ; }
Converts a record to a propagator result
Converts a record to a propagator result
Result corresponding to the given record
Result corresponding to the given record
stateEntry
IEntityStateEntry
state manager entry containing the record
state manager entry containing the record
isModified
bool
Indicates whether the root element is modified
Indicates whether the root element is modified
record
IExtendedDataRecord
Record to convert
Record to convert
useCurrentValues
bool
Indicates whether we are retrieving current or original values.
Indicates whether we are retrieving current or original values .
translator
UpdateTranslator
Translator for session context; registers new metadata for the record type if none exists
Translator for session context ; registers new metadata for the record type if none exists
modifiedPropertiesBehavior
ModifiedPropertiesBehavior
Indicates how to determine whether a property is modified.
Indicates how to determine whether a property is modified .