public void ApplyInjections()
        {
            var contentMetadata = metadataManager.GetMetadata <TestPageContent>();
            var services        = new ServiceCollection().AddScoped <TestService>();

            using (var serviceProvider = services.BuildServiceProvider())
            {
                using (var serviceScope = serviceProvider.CreateScope())
                {
                    var page = TestPageContent.Create("test", new PageHeaderContent(), new List <PageHeaderContent> {
                        new PageHeaderContent()
                    });

                    metadataManager.ApplyInjections(page, serviceScope.ServiceProvider, false);

                    Assert.NotNull(page.Service);
                    Assert.Null(page.Header.Service);
                    Assert.Null(page.Headers[0].Service);
                }
            }
        }
        public async Task <ContentProvider <TEntry> > GetContentAsync(TEntry entry, CancellationToken cancellationToken = default)
        {
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }

            var contentData = await store.GetContentDataAsync(entry, cancellationToken);

            if (contentData == null)
            {
                return(null);
            }

            var model = contentMetadataManager.ConvertDictionaryToContentModel(contentData);

            contentMetadataManager.ApplyInjections(model, services, true);

            return(ContentProvider <TEntry> .Create(entry, model, services));
        }