DataServiceProvider.DSPMetadata.GetResourceAssociationSet C# (CSharp) Method

GetResourceAssociationSet() public method

Gets the ResourceAssociationSet instance when given the source association end.
This method returns a ResourceAssociationSet representing a reference which is specified by the resourceProperty on the resourceType for instances in the resourceSet.
public GetResourceAssociationSet ( System.Data.Services.Providers.ResourceSet resourceSet, System.Data.Services.Providers.ResourceType resourceType, System.Data.Services.Providers.ResourceProperty resourceProperty ) : System.Data.Services.Providers.ResourceAssociationSet
resourceSet System.Data.Services.Providers.ResourceSet Resource set of the source association end.
resourceType System.Data.Services.Providers.ResourceType Resource type of the source association end.
resourceProperty System.Data.Services.Providers.ResourceProperty Resource property of the source association end.
return System.Data.Services.Providers.ResourceAssociationSet
        public ResourceAssociationSet GetResourceAssociationSet(ResourceSet resourceSet, ResourceType resourceType, ResourceProperty resourceProperty)
        {
            // We have the resource association set precreated on the property annotation, so no need to compute anything in here
            var resourceAssociationSet = resourceProperty.GetAnnotation().ResourceAssociationSet;

            // Just few verification to show what is expected of the returned resource association set.
            Debug.Assert(resourceAssociationSet.End1.ResourceSet == resourceSet, "The precreated resource association set doesn't match the specified resource set.");
            Debug.Assert(resourceAssociationSet.End1.ResourceType == resourceType, "The precreated resource association set doesn't match the specified resource type.");
            Debug.Assert(resourceAssociationSet.End1.ResourceProperty == resourceProperty, "The precreated resource association set doesn't match its resource property.");

            return resourceAssociationSet;
        }