public MessagePackSerializer <TObject> CreateSerializer()
        {
            SerializingMember[] source = (from item in SerializerBuilder <TObject> .GetTargetMembers()
                                          orderby item.Contract.Id
                                          select item).ToArray <SerializingMember>();
            if (source.Length == 0)
            {
                throw SerializationExceptions.NewNoSerializableFieldsException(typeof(TObject));
            }
            if (source.All <SerializingMember>(item => item.Contract.Id == -1))
            {
                return(this.CreateSerializer((from item in source
                                              orderby item.Contract.Name
                                              select item).ToArray <SerializingMember>()));
            }
            Contract.Assert(source[0].Contract.Id >= 0);
            if (this.Context.CompatibilityOptions.OneBoundDataMemberOrder && (source[0].Contract.Id == 0))
            {
                throw new NotSupportedException("Cannot specify order value 0 on DataMemberAttribute when SerializationContext.CompatibilityOptions.OneBoundDataMemberOrder is set to true.");
            }
            List <SerializingMember> list = new List <SerializingMember>(source.Max <SerializingMember>(item => item.Contract.Id) + 1);
            int index = 0;

            for (int i = this.Context.CompatibilityOptions.OneBoundDataMemberOrder ? 1 : 0; index < source.Length; i++)
            {
                Contract.Assert(source[index].Contract.Id >= 0);
                if (source[index].Contract.Id < i)
                {
                    throw new SerializationException(string.Format(CultureInfo.CurrentCulture, "The member ID '{0}' is duplicated in the '{1}' type.", new object[] { source[index].Contract.Id, typeof(TObject) }));
                }
                while (source[index].Contract.Id > i)
                {
                    SerializingMember member = new SerializingMember();
                    list.Add(member);
                    i++;
                }
                list.Add(source[index]);
                index++;
            }
            return(this.CreateSerializer(list.ToArray()));
        }
		internal static PolymorphismSchema Create(
			Type type,
#if !UNITY
			SerializingMember? memberMayBeNull
 public static string aotName(SerializingMember item)
 {
     return(item.Contract.Name);
 }
 public static bool aotBool(SerializingMember item)
 {
     return(item.Contract.Id == DataMemberContract.UnspecifiedId);
 }
 public static int aotInt(SerializingMember item)
 {
     return(item.Contract.Id);
 }