public void EmitAddHttpRequestMessagePropertyProperty(EmittedProperty property)
 {
     this.ilGenerator.Emit(OpCodes.Ldloc, this.requestInfoLocal);
     this.ilGenerator.Emit(OpCodes.Ldstr, property.PropertyModel.HttpRequestMessagePropertyAttributeKey);
     this.ilGenerator.Emit(OpCodes.Ldarg_0);
     this.ilGenerator.Emit(OpCodes.Ldfld, property.FieldBuilder);
     if (property.FieldBuilder.FieldType.GetTypeInfo().IsValueType)
     {
         this.ilGenerator.Emit(OpCodes.Box, property.FieldBuilder.FieldType);
     }
     this.ilGenerator.Emit(OpCodes.Callvirt, MethodInfos.RequestInfo_AddRequestPropertyProperty);
 }
        public void EmitAddQueryProperty(EmittedProperty property, QuerySerializationMethod serializationMethod)
        {
            Assert(property.PropertyModel.QueryAttribute != null);
            var attribute   = property.PropertyModel.QueryAttribute.Attribute;
            var typedMethod = MethodInfos.RequestInfo_AddQueryProperty.MakeGenericMethod(property.FieldBuilder.FieldType);

            this.ilGenerator.Emit(OpCodes.Ldloc, this.requestInfoLocal);
            this.ilGenerator.Emit(OpCodes.Ldc_I4, (int)serializationMethod);
            this.ilGenerator.Emit(OpCodes.Ldstr, property.PropertyModel.QueryAttributeName);
            this.ilGenerator.Emit(OpCodes.Ldarg_0);
            this.ilGenerator.Emit(OpCodes.Ldfld, property.FieldBuilder);
            this.LoadString(attribute.Format);
            this.ilGenerator.Emit(OpCodes.Callvirt, typedMethod);
        }
        public void EmitAddHeaderProperty(EmittedProperty property)
        {
            Assert(property.PropertyModel.HeaderAttribute != null);
            var attribute   = property.PropertyModel.HeaderAttribute.Attribute;
            var typedMethod = MethodInfos.RequestInfo_AddPropertyHheader.MakeGenericMethod(property.FieldBuilder.FieldType);

            this.ilGenerator.Emit(OpCodes.Ldloc, this.requestInfoLocal);
            this.ilGenerator.Emit(OpCodes.Ldstr, attribute.Name);
            this.ilGenerator.Emit(OpCodes.Ldarg_0);
            this.ilGenerator.Emit(OpCodes.Ldfld, property.FieldBuilder);
            this.LoadString(attribute.Value);
            this.LoadString(attribute.Format);
            this.ilGenerator.Emit(OpCodes.Callvirt, typedMethod);
        }