ReflectionDelegateFactory
using Newtonsoft.Json.Serialization;
using System;
using System.Globalization;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace Newtonsoft.Json.Utilities
{
    [System.Runtime.CompilerServices.NullableContext(1)]
    [System.Runtime.CompilerServices.Nullable(0)]
    internal abstract class ReflectionDelegateFactory
    {
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public Func<T, object> CreateGet<[System.Runtime.CompilerServices.Nullable(2)] T>(MemberInfo memberInfo)
        {
            PropertyInfo propertyInfo = memberInfo as PropertyInfo;
            if ((object)propertyInfo != null) {
                if (propertyInfo.PropertyType.IsByRef)
                    throw new InvalidOperationException("Could not create getter for {0}. ByRef return values are not supported.".FormatWith(CultureInfo.InvariantCulture, propertyInfo));
                return CreateGet<T>(propertyInfo);
            }
            FieldInfo fieldInfo = memberInfo as FieldInfo;
            if ((object)fieldInfo != null)
                return CreateGet<T>(fieldInfo);
            throw new Exception("Could not create getter for {0}.".FormatWith(CultureInfo.InvariantCulture, memberInfo));
        }
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public Action<T, object> CreateSet<[System.Runtime.CompilerServices.Nullable(2)] T>(MemberInfo memberInfo)
        {
            PropertyInfo propertyInfo = memberInfo as PropertyInfo;
            if ((object)propertyInfo != null)
                return CreateSet<T>(propertyInfo);
            FieldInfo fieldInfo = memberInfo as FieldInfo;
            if ((object)fieldInfo != null)
                return CreateSet<T>(fieldInfo);
            throw new Exception("Could not create setter for {0}.".FormatWith(CultureInfo.InvariantCulture, memberInfo));
        }
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public abstract MethodCall<T, object> CreateMethodCall<[System.Runtime.CompilerServices.Nullable(2)] T>(MethodBase method);
        public abstract ObjectConstructor<object> CreateParameterizedConstructor(MethodBase method);
        public abstract Func<T> CreateDefaultConstructor<[System.Runtime.CompilerServices.Nullable(2)] T>(Type type);
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public abstract Func<T, object> CreateGet<[System.Runtime.CompilerServices.Nullable(2)] T>(PropertyInfo propertyInfo);
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public abstract Func<T, object> CreateGet<[System.Runtime.CompilerServices.Nullable(2)] T>(FieldInfo fieldInfo);
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public abstract Action<T, object> CreateSet<[System.Runtime.CompilerServices.Nullable(2)] T>(FieldInfo fieldInfo);
        [return: System.Runtime.CompilerServices.Nullable(new byte[] {
            1,
            1,
            2
        })]
        public abstract Action<T, object> CreateSet<[System.Runtime.CompilerServices.Nullable(2)] T>(PropertyInfo propertyInfo);
    }
}