[BUG] OriginalObjectGetter is missing for WebContent

Member since: 2007
 

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
  •  

    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
  •  

    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