src/Shared/EntityFramework/ModelConfiguration/Edm/MetadataPropertyExtensions.cs
// <summary>
// Sets an annotation on a set of properties.
// </summary>
// <param name="metadataProperties">The properties.</param>
// <param name="name">The name of the annotation.</param>
// <param name="value">The value of the annotation.</param>
Sets an annotation on a set of properties.
Sets an annotation on a set of properties .
public static void SetAnnotation(
            this ICollection<MetadataProperty> metadataProperties, string name, object value)
        {
            DebugCheck.NotNull(metadataProperties);
            DebugCheck.NotEmpty(name);
            DebugCheck.NotNull(value);
            var property = metadataProperties.SingleOrDefault(p => p.Name.Equals(name, StringComparison.Ordinal));
            if (property == null)
            {
                property = MetadataProperty.CreateAnnotation(name, value);
                metadataProperties.Add(property);
            }
            else
            {
                Debug.Assert(property.IsAnnotation);
                property.Value = value;
            }
        }
public static void SetAnnotation ( this ICollection < MetadataProperty > metadataProperties , string name , object value ) { DebugCheck . NotNull ( metadataProperties ) ; DebugCheck . NotEmpty ( name ) ; DebugCheck . NotNull ( value ) ; var property = metadataProperties . SingleOrDefault ( p => p . Name . Equals ( name , StringComparison . Ordinal ) ) ; if ( property == null ) { property = MetadataProperty . CreateAnnotation ( name , value ) ; metadataProperties . Add ( property ) ; } else { Debug . Assert ( property . IsAnnotation ) ; property . Value = value ; } }
Sets an annotation on a set of properties.
Sets an annotation on a set of properties .
ICollection<MetadataProperty>
this
name
string
The name of the annotation.
The name of the annotation .
value
object
The value of the annotation.
The value of the annotation .
metadataProperties
None