private void createUpdateOperationRequestMessage(ref ODataBatchWriter writer, Change change, string tableName, string[] headers) { string id = this.getKeyType(tableName).IsString() ? "'" + change.id + "'" : change.id; Uri uri = new Uri(tableName + "(" + id + ")", UriKind.Relative); var updateOperaitonMessage = writer.CreateOperationRequestMessage("PATCH", uri); updateOperaitonMessage.SetHeader("Content-Type", "application/json"); using (var operationMessageWriter = new ODataMessageWriter(updateOperaitonMessage)) { var entityWriter = operationMessageWriter.CreateODataEntryWriter(); var entry = new ODataEntry() { Properties = createOperationProperties(change.data, tableName, headers), TypeName = this.GetEntityTypeName(tableName) }; entityWriter.WriteStart(entry); entityWriter.WriteEnd(); } }
private void createDeleteOperationRequestMessage(ref ODataBatchWriter writer, Change change, string tableName) { string id = this.getKeyType(tableName).IsString() ? "'" + change.id + "'" : change.id; Uri uri = new Uri(tableName + "(" + id + ")", UriKind.Relative); writer.CreateOperationRequestMessage("DELETE", uri); }
internal static ODataRequestMessageWrapper CreateBatchPartRequestMessage(ODataBatchWriter batchWriter, string method, Uri requestUrl, RequestInfo requestInfo) { return new ODataRequestMessageWrapper(batchWriter.CreateOperationRequestMessage(method, requestUrl), requestInfo) { IsBatchPartRequest = true }; }