private static void sum_plus_count_final(sqlite3_context ctx, object user_data) { if (ctx.state == null) { ctx.state = new my_state(); } my_state st = ctx.state as my_state; ctx.result_int64(st.sum + st.count); }
private static void sum_plus_count_step(sqlite3_context ctx, object user_data, sqlite3_value[] args) { Assert.AreEqual(args.Length, 1); if (ctx.state == null) { ctx.state = new my_state(); } my_state st = ctx.state as my_state; st.sum += args[0].value_int64(); st.count++; }