I have seen several threads on this, but am still a little confused on the best way to do this.
I have an entity "Product". This has a related collection of "AdditionalImage" entities. I delete an image entity directly using adapter.DeleteEntitiesDirectly. My related "productEntity.ProductAdditionalImages" is now out of sync. What is the best way to get this collection back into sync? See example of method below for deleting additional image.
public static void RemoveAdditionalImage(ProductEntity productEntity, CMSImage cmsImage)
{
DataAccessAdapter adapter = new DataAccessAdapter();
adapter.DeleteEntitiesDirectly(
typeof(Llbl.EntityClasses.AdditionalImagesEntity),
cmsImage.CMSImageEntity.GetRelationInfoAdditionalImages());
cmsImage.Delete(false);
}
I am using the adapter templates (V2.5).
Thanks for any help.