Is it possible to retrieve pages that uses a shared block instance in EPIserver 7.
You can use ContentSoftLinkRepository
to get references to/from the content item. Let's say blockLink
is the content reference of your block.
// resolving the repository. It can also be injected as a property or in your constructor.
var linkRepository = ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>();
// loading soft links for your block
var referencingContentLinks = linkRepository.Load(blockLink, true).Where(link =>
link.SoftLinkType == ReferenceType.PageLinkReference &&
!ContentReference.IsNullOrEmpty(link.OwnerContentLink))
.Select(link => link.OwnerContentLink)
.ToList();
Now you have the list of content links of pages/blocks/... that uses/references your block.