Yesterday I was trying to assign a contact to organization in my code. It seemed really natural to had such a requirement but unfortunatelly I didn't find any examples.
In Mediachase.Commerce.Customers.CustomerContext class there is a method called InnerGetAllCustomerContactsInOrganization. It lists all Contact entities filtered by OwnerId field. So we can set link between this two entities in a following way:
myContact.OwnerId = myOrganization.PrimaryKeyId;
Hope this helps.
No comments:
Post a Comment