Skip to content

Instantly share code, notes, and snippets.

@trnktms
Last active August 17, 2022 09:25
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/b223a210eb01720701108f62f469a40d to your computer and use it in GitHub Desktop.
Save trnktms/b223a210eb01720701108f62f469a40d to your computer and use it in GitHub Desktop.
public class CustomContentsResolver : RenderingContentsResolver
{
private readonly ICustomItemSerializer _customItemSerializer;
private readonly IRenderingConfigFactory _renderingConfigFactory;
public CustomContentsResolver(
ICustomItemSerializer customItemSerializer,
IRenderingConfigFactory renderingConfigFactory)
{
_customItemSerializer = customItemSerializer;
_renderingConfigFactory = renderingConfigFactory;
}
public override object ResolveContents(Rendering rendering, IRenderingConfiguration renderingConfig)
{
var customRenderingConfig = _renderingConfigFactory.Create(renderingConfig, _customItemSerializer);
return base.ResolveContents(rendering, customRenderingConfig);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment