Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sitecore merging facets with MergeContactFacets facet
internal class MergeContactFacets : MergeContactProcessor
{
public override void Process(MergeContactArgs args)
{
Assert.ArgumentNotNull((object) args, "args");
foreach (string name in args.DyingContact.Facets.Keys)
{
IFacet source = args.DyingContact.Facets[name];
IFacet destination = (IFacet) null;
try
{
destination = args.SurvivingContact.GetFacet<IFacet>(name);
}
catch (FacetNotAvailableException ex)
{
}
if (destination != null && destination.IsEmpty)
ModelUtilities.DeepCopyFacet(source, destination);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment