/// <summary> /// Batches an <b>execute</b> of an <b>OData</b> request for a specified <paramref name="pathAndQuery"/> with a <typeparamref name="TReq"/> request and <typeparamref name="TRes"/> response value. /// </summary> /// <param name="exeArgs">The <see cref="ODataArgs"/>.</param> /// <param name="pathAndQuery">The url path and query <see cref="string"/> (excluding the base URI path).</param> /// <param name="value">The request value.</param> /// <returns>The <see cref="ODataBatchItem"/>.</returns> /// <remarks>The <see cref="HttpMethod"/> defaults to a <see cref="HttpMethod.Post"/>. This is overridden using the <see cref="ODataArgs.OverrideHttpMethod"/>.</remarks> public async Task <ODataBatchItem> ExecuteAsync <TReq, TRes>(ODataArgs exeArgs, string pathAndQuery, TReq value) { var obi = AddRequest(await OData.BuildExecuteRequestAsync(exeArgs, pathAndQuery, value).ConfigureAwait(false)); obi.GetValueFunc = async() => await OData.ProcessExecuteResponseAsync <TRes>(obi.ResponseMessage, exeArgs).ConfigureAwait(false); return(obi); }
/// <summary> /// Batches an <b>execute</b> of an <b>OData</b> request for a specified <paramref name="pathAndQuery"/> using a <see cref="JObject"/> for the request and response. /// </summary> /// <param name="exeArgs">The <see cref="ODataArgs"/>.</param> /// <param name="pathAndQuery">The url path and query <see cref="string"/> (excluding the base URI path).</param> /// <param name="json">Optional JSON request content.</param> /// <returns>The <see cref="ODataBatchItem"/>.</returns> /// <remarks>The <see cref="HttpMethod"/> defaults to a <see cref="HttpMethod.Post"/>. This is overridden using the <see cref="ODataArgs.OverrideHttpMethod"/>.</remarks> public async Task <ODataBatchItem> ExecuteAsync(ODataArgs exeArgs, string pathAndQuery, JObject json) { var obi = AddRequest(await OData.BuildExecuteRequestAsync(exeArgs, pathAndQuery, json)); obi.GetValueFunc = async() => await OData.ProcessExecuteResponseAsync(obi.ResponseMessage, exeArgs); return(obi); }
/// <summary> /// Batches an <b>execute</b> of an <b>OData</b> request for a specified <paramref name="pathAndQuery"/> with a <typeparamref name="TReq"/> request value. /// </summary> /// <param name="exeArgs">The <see cref="ODataArgs"/>.</param> /// <param name="pathAndQuery">The url path and query <see cref="string"/> (excluding the base URI path).</param> /// <param name="value">The request value.</param> /// <returns>The <see cref="ODataBatchItem"/>.</returns> /// <remarks>The <see cref="HttpMethod"/> defaults to a <see cref="HttpMethod.Post"/>. This is overridden using the <see cref="ODataArgs.OverrideHttpMethod"/>.</remarks> public async Task <ODataBatchItem> ExecuteAsync <TReq>(ODataArgs exeArgs, string pathAndQuery, TReq value) { return(AddRequest(await OData.BuildExecuteRequestAsync(exeArgs, pathAndQuery, value).ConfigureAwait(false))); }
/// <summary> /// Batches an <b>execute</b> of an <b>OData</b> request for a specified <paramref name="pathAndQuery"/>. /// </summary> /// <param name="exeArgs">The <see cref="ODataArgs"/>.</param> /// <param name="pathAndQuery">The url path and query <see cref="string"/> (excluding the base URI path).</param> /// <returns>The <see cref="ODataBatchItem"/>.</returns> /// <remarks>The <see cref="HttpMethod"/> defaults to a <see cref="HttpMethod.Post"/>. This is overridden using the <see cref="ODataArgs.OverrideHttpMethod"/>.</remarks> public async Task <ODataBatchItem> ExecuteAsync(ODataArgs exeArgs, string pathAndQuery) { return(AddRequest(await OData.BuildExecuteRequestAsync(exeArgs, pathAndQuery))); }