src/Shared/EntityFramework/ModelConfiguration/Edm/MetadataPropertyExtensions.cs
// <summary>
// Gets the annotation from a set of properties. 
// </summary>
// <param name="metadataProperties">The properties.</param>
// <param name="name">The name of the annotation.</param>
// <returns>The annotation.</returns>
Gets the annotation from a set of properties.
Gets the annotation from a set of properties .
public static object GetAnnotation(this IEnumerable<MetadataProperty> metadataProperties, string name)
        {
            DebugCheck.NotNull(metadataProperties);
            DebugCheck.NotEmpty(name);
            foreach(var p in metadataProperties)
            {
                if (p.Name.Equals(name, StringComparison.Ordinal))
                {
                    Debug.Assert(p.IsAnnotation);
                    return p.Value;
                }
            }
            return null;
        }
public static object GetAnnotation ( this IEnumerable < MetadataProperty > metadataProperties , string name ) { DebugCheck . NotNull ( metadataProperties ) ; DebugCheck . NotEmpty ( name ) ; foreach ( var p in metadataProperties ) { if ( p . Name . Equals ( name , StringComparison . Ordinal ) ) { Debug . Assert ( p . IsAnnotation ) ; return p . Value ; } } return null ; }
Gets the annotation from a set of properties.
Gets the annotation from a set of properties .
// PERF: this code written this way since it's part of a hotpath, consider its performance when refactoring. See codeplex #2298.
None
IEnumerable<MetadataProperty>
this
name
string
The name of the annotation.
The name of the annotation .
metadataProperties
None