IdeaBlade DevForce 2010 Help Reference
ReferenceStrategy Property
See Also  Example Send Feedback
IdeaBlade.EntityModel Assembly > IdeaBlade.EntityModel Namespace > EntityRelationRole Class : ReferenceStrategy Property



Gets or sets the EntityReferenceStrategy that determines how references using this role are resolved.

Syntax

Visual Basic (Declaration) 
<DataMemberAttribute()>
Public Property ReferenceStrategy As EntityReferenceStrategy
Visual Basic (Usage)Copy Code
Dim instance As EntityRelationRole
Dim value As EntityReferenceStrategy
 
instance.ReferenceStrategy = value
 
value = instance.ReferenceStrategy
C# 
[DataMemberAttribute()]
public EntityReferenceStrategy ReferenceStrategy {get; set;}
C++/CLI 
[DataMemberAttribute()]
public:
property EntityReferenceStrategy^ ReferenceStrategy {
   EntityReferenceStrategy^ get();
   void set (    EntityReferenceStrategy^ value);
}

Example

C#Copy Code
// Globally change the strategy for the Customer.OrderSummaries relation:
var ers = new EntityReferenceStrategy(EntityReferenceLoadStrategy.Load, MergeStrategy.PreserveChanges);
Customer.OrderSummariesEntityProperty.ReferenceStrategy = ers;

Remarks

You can set this value to override the Default strategy set when the EntityRelation was constructed. Changing the strategy affects only the EntityReference for this specific end of the EntityRelation.
              // Globally change the strategy for the Customer.OrderSummaries relation:
              var ers = new EntityReferenceStrategy(EntityReferenceLoadStrategy.Load, MergeStrategy.PreserveChanges);
              Customer.OrderSummariesEntityProperty.ReferenceStrategy = ers;
            

Requirements

Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family

See Also

© 2013 All Rights Reserved.