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
We used to get IContent by the SearchResult.Id like so:
IContent
SearchResult.Id
private void GetContent(SearchResult searchResult) { var content = _contentService.GetById(searchResult.Id); // do stuff with content }
Right now using ISearchResult we are not able to get content, as its Id property was changed to string in new version of Examine.
ISearchResult
string
Examine
Do you know how can I achieve this in Umbraco 8?
Umbraco 8
Hi Sebastian,
The Id property still holds the numeric ID, but now as a string. So _contentService.GetById(int.Parse(searchResult.Id)) should do do the trick ;)
Id
_contentService.GetById(int.Parse(searchResult.Id))
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get IContent by ISearchResult
We used to get
IContent
by theSearchResult.Id
like so:Right now using
ISearchResult
we are not able to get content, as its Id property was changed tostring
in new version ofExamine
.Do you know how can I achieve this in
Umbraco 8
?Hi Sebastian,
The
Id
property still holds the numeric ID, but now as a string. So_contentService.GetById(int.Parse(searchResult.Id))
should do do the trick ;)is working on a reply...