public async Task <uint> PostAsync(AddDBFunction addDB) { var receipt = await Service.AddDBRequestAndWaitForReceiptAsync(addDB); var AddDbEvent = receipt.DecodeAllEvents <DbCreatedEventDTO>(); return(AddDbEvent.LastOrDefault().Event.DbId); }
public Task <TransactionReceipt> AddDBRequestAndWaitForReceiptAsync(byte[] iPAddress, CancellationTokenSource cancellationToken = null) { var addDBFunction = new AddDBFunction(); addDBFunction.IPAddress = iPAddress; return(ContractHandler.SendRequestAndWaitForReceiptAsync(addDBFunction, cancellationToken)); }
public Task <string> AddDBRequestAsync(byte[] iPAddress) { var addDBFunction = new AddDBFunction(); addDBFunction.IPAddress = iPAddress; return(ContractHandler.SendRequestAsync(addDBFunction)); }
public async Task <uint> PostAsync(AddDBFunction addDB) { using (HttpClient client = new HttpClient()) { uint ret = uint.MaxValue; StringContent cont = new StringContent(JsonConvert.SerializeObject(addDB)); var response = await client.PostAsync(uri + "/", cont); if (response.IsSuccessStatusCode) { var t = await response.Content.ReadAsStringAsync(); ret = JsonConvert.DeserializeObject <uint>(t); } Globals.AddDB(ret, addDB.IPAddress.ToString()); return(ret); } }
public Task <TransactionReceipt> AddDBRequestAndWaitForReceiptAsync(AddDBFunction addDBFunction, CancellationTokenSource cancellationToken = null) { return(ContractHandler.SendRequestAndWaitForReceiptAsync(addDBFunction, cancellationToken)); }
public Task <string> AddDBRequestAsync(AddDBFunction addDBFunction) { return(ContractHandler.SendRequestAsync(addDBFunction)); }