Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Is there anyone that has a solution for casting iContent to iPublishedContent in v8?
In v7 is was using this extension method but it don't works in v8.
After the conversation yesterday I decided to check it out a bit with the snapshotservice and I figured out what changed thanks to Nathan Woulfe on the Slack community.
Seems they slightly changed how to get preview IContent content. Here is an excerpt from my content api package:
public class PreviewApiController : UmbracoApiController
private readonly Lazy<IContentResolver> _contentResolver;
private readonly IPublishedSnapshotService _publishedSnapshotService;
private readonly IUserService _userService;
private readonly IContentService _contentService;
public PreviewApiController(Lazy<IContentResolver> contentResolver, IPublishedSnapshotService publishedSnapshotService, IUserService userService, IContentService contentService)
_contentResolver = contentResolver;
_publishedSnapshotService = publishedSnapshotService;
_userService = userService;
_contentService = contentService;
public IHttpActionResult Get(Guid id)
IPublishedContent content = _publishedSnapshotService.CreatePublishedSnapshot(
ContentModel contentModel = _contentResolver.Value.ResolveContent(content);
I just verified this works in Umbraco 8.3
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted