src/OpenTracing.Contrib.NetCore/Internal/PropertyFetcher.cs
/// <summary>
/// Given an object fetch the property that this PropertySpec represents.
/// </summary>
Given an object fetch the property that this PropertySpec represents.
Given an object fetch the property that this PropertySpec represents .
public object Fetch(object obj)
        {
            Type objType = obj.GetType();
            if (objType != _expectedType)
            {
                TypeInfo typeInfo = objType.GetTypeInfo();
                var propertyInfo = typeInfo.DeclaredProperties.FirstOrDefault(p => string.Equals(p.Name, _propertyName, StringComparison.InvariantCultureIgnoreCase));
                _fetchForExpectedType = PropertyFetch.FetcherForProperty(propertyInfo);
                _expectedType = objType;
            }
            return _fetchForExpectedType.Fetch(obj);
        }
public object Fetch ( object obj ) { Type objType = obj . GetType ( ) ; if ( objType != _expectedType ) { TypeInfo typeInfo = objType . GetTypeInfo ( ) ; var propertyInfo = typeInfo . DeclaredProperties . FirstOrDefault ( p => string . Equals ( p . Name , _propertyName , StringComparison . InvariantCultureIgnoreCase ) ) ; _fetchForExpectedType = PropertyFetch . FetcherForProperty ( propertyInfo ) ; _expectedType = objType ; } return _fetchForExpectedType . Fetch ( obj ) ; }
Given an object fetch the property that this PropertySpec represents.
Given an object fetch the property that this PropertySpec represents .
obj
object