Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public interface IRenderingConfigFactory
{
IRenderingConfiguration Create<T>(IRenderingConfiguration renderingConfig, T itemSerializer) where T : class, IItemSerializer;
}
public class RenderingConfigFactory : IRenderingConfigFactory
{
public IRenderingConfiguration Create<T>(IRenderingConfiguration renderingConfig, T itemSerializer) where T : class, IItemSerializer
{
return new DefaultRenderingConfiguration
{
IncludeServerUrlInContextItemMediaUrls = renderingConfig.IncludeServerUrlInContextItemMediaUrls,
ItemSerializer = itemSerializer, // Custom item serializer
Name = renderingConfig.Name,
PlaceholdersResolver = renderingConfig.PlaceholdersResolver,
RenderingContentsResolver = renderingConfig.RenderingContentsResolver,
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment