[BUG] OriginalObjectGetter is missing for WebContent

Vote:
 

Hi,

OriginalObjectGetter is missing for WebContent. Is this by-design? This means we can't do following:

private static WebContent GetWebContent(UnifiedSearchHit hit)
{
    if (hit.OriginalObjectGetter != null)
    {
        var original = hit.OriginalObjectGetter.Invoke();

        if (original is WebContent)
        {
            return (WebContent)original;
        }
    }

    return null;
}
#150369
Edited, Jun 16, 2016 17:49
Vote:
 

Hi Johan,

   Did you manage to overcome or arrive at a solution when OriginalObjectGetter is null. I am trying to do similar thing to get web content from search, but fails because my OriginalObjectGetter is null.

Thanks,

Rams

#186696
Jan 02, 2018 14:30
Vote:
 

Hi Johan and Ram,

Did you find a solution to this? My method looks like this today:

public static T GetOriginalObject<T>(this UnifiedSearchHit hit)
{
         if (hit.OriginalObjectGetter != null)
         {
               var original = hit.OriginalObjectGetter.Invoke();

                if (original is T)
                {
                    return (T)original;
                 }
           }

           return default(T);
}



Thanks

#190252
Edited, Apr 06, 2018 10:21
Vote:
 

This is the case for BlockData hits too.

#201489
Feb 20, 2019 13:29
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.