src/OpenTracing.Contrib.NetCore/Internal/PropertyFetcher.cs
/// <summary>
/// Create a property fetcher from a .NET Reflection PropertyInfo class that
/// represents a property of a particular type.
/// </summary>
Create a property fetcher from a .NET Reflection PropertyInfo class that
represents a property of a particular type.
Create a property fetcher from a . NET Reflection PropertyInfo class that represents a property of a particular type .
public static PropertyFetch FetcherForProperty(PropertyInfo propertyInfo)
            {
                if (propertyInfo == null)
                    return new PropertyFetch();     
                Type typedPropertyFetcher = typeof(TypedFetchProperty<,>);
                Type instantiatedTypedPropertyFetcher = typedPropertyFetcher.GetTypeInfo().MakeGenericType(
                    propertyInfo.DeclaringType, propertyInfo.PropertyType);
                return (PropertyFetch)Activator.CreateInstance(instantiatedTypedPropertyFetcher, propertyInfo);
            }
public static PropertyFetch FetcherForProperty ( PropertyInfo propertyInfo ) { if ( propertyInfo == null ) return new PropertyFetch ( ) ; Type typedPropertyFetcher = typeof ( TypedFetchProperty < , > ) ; Type instantiatedTypedPropertyFetcher = typedPropertyFetcher . GetTypeInfo ( ) . MakeGenericType ( propertyInfo . DeclaringType , propertyInfo . PropertyType ) ; return ( PropertyFetch ) Activator . CreateInstance ( instantiatedTypedPropertyFetcher , propertyInfo ) ; }
Create a property fetcher from a .NET Reflection PropertyInfo class that
represents a property of a particular type.
Create a property fetcher from a . NET Reflection PropertyInfo class that represents a property of a particular type .
// returns null on any fetch.
propertyInfo
PropertyInfo