Skip to content

Instantly share code, notes, and snippets.

@trnktms
Created August 17, 2022 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trnktms/405127667a7b7e3ec93c681b739111e4 to your computer and use it in GitHub Desktop.
Save trnktms/405127667a7b7e3ec93c681b739111e4 to your computer and use it in GitHub Desktop.
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