When I am linking annotations to a specific entity, rather than creating a relationship like so:
var associateRequest = new AssociateRequest
{
Target = new EntityReference(SalesOrder.EntityLogicalName, salesOrderGuid),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference(Annotation.EntityLogicalName, noteGuid),
},
Relationship = new Relationship("SalesOrder_Annotation")
};
Is it possible to reference the relationship in a strongly typed way:
var associateRequest = new AssociateRequest
{
Target = new EntityReference(SalesOrder.EntityLogicalName, salesOrderGuid),
RelatedEntities = new EntityReferenceCollection
{
new EntityReference(Annotation.EntityLogicalName, noteGuid)
},
Relationship = SalesOrder.Relationships.SalesOrder_Annotation // <----- ???
};
This would be similar to being able to get the logicalname at develop time:
SalesOrder.EntityLogicalName
Can we reference the specific 1:N relationship the same way:
SalesOrder.Relationships.SalesOrder_Annotation