//--------------------------------------------------------------------- // // Copyright (c) Microsoft Corporation. All rights reserved. // // // @owner Microsoft // @backupOwner Microsoft //--------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; using System.Threading; using System.Data.Objects.DataClasses; namespace System.Data.Metadata.Edm { /// /// Represents a end of a Association Type /// public sealed class AssociationEndMember : RelationshipEndMember { #region Constructors /// /// Initializes a new instance of AssociationEndMember /// /// name of the association end member /// Ref type that this end refers to /// multiplicity of the end internal AssociationEndMember(string name, RefType endRefType, RelationshipMultiplicity multiplicity) : base(name, endRefType, multiplicity) { } #endregion /// /// Returns the kind of the type /// public override BuiltInTypeKind BuiltInTypeKind { get { return BuiltInTypeKind.AssociationEndMember; } } private Func _getRelatedEndMethod = null; /// cached dynamic method to set a CLR property value on a CLR instance internal Func GetRelatedEnd { get { return _getRelatedEndMethod; } set { System.Diagnostics.Debug.Assert(null != value, "clearing GetRelatedEndMethod"); // It doesn't matter which delegate wins, but only one should be jitted Interlocked.CompareExchange(ref _getRelatedEndMethod, value, null); } } } }