public void TestLongStringItems() { using (var ctxt = TestUtils.GetCtxt()) { string longStr; ctxt.Cmd.CreateTableAsync("blet", isNumeric: false).Wait(); Define define = new Define("blet", "monkey"); ctxt.Cmd.DefineAsync(define).Wait(); long monkeyId = ctxt.GetRowIdAsync("blet", "monkey").Result; LongStringOp get = new LongStringOp() { table = "blet", fieldName = "foo", itemId = monkeyId }; longStr = ctxt.Cmd.GetLongStringAsync(get).Result; Assert.IsNull(longStr); LongStringPut put = new LongStringPut() { table = "blet", fieldName = "foo", itemId = monkeyId, longString = "bar" }; ctxt.Cmd.PutLongStringAsync(put).Wait(); longStr = ctxt.Cmd.GetLongStringAsync(get).Result; Assert.AreEqual("bar", longStr); LongStringOp del = new LongStringOp() { table = "blet", fieldName = "foo", itemId = monkeyId }; ctxt.Cmd.DeleteLongStringAsync(del).Wait(); longStr = ctxt.Cmd.GetLongStringAsync(get).Result; Assert.IsNull(longStr); } }
/// <summary> /// Put a long strings into the database /// </summary> /// <param name="put">String put request</param> public async Task PutLongStringAsync(LongStringPut put) { await LongStrings.StoreStringAsync(Ctxt, put.itemId, put.fieldName, put.longString).ConfigureAwait(false); }