From 152ed2cde158f808b3ae8d17aad32f6b935e66c3 Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Fri, 25 Apr 2025 09:28:28 -0400 Subject: [PATCH 1/2] Fix example that was still rust-ey in C# ref This must have gotten missed when porting the Rust ref over to C#. --- docs/modules/c-sharp/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/modules/c-sharp/index.md b/docs/modules/c-sharp/index.md index 3deeb2b7..1c02ac18 100644 --- a/docs/modules/c-sharp/index.md +++ b/docs/modules/c-sharp/index.md @@ -480,12 +480,12 @@ public static partial class Module { [Reducer] void Demo(ReducerContext ctx) { var idIndex = ctx.Db.user.Id; - var exampleUser = idIndex.find(357).unwrap(); - exampleUser.dog_count += 5; - idIndex.update(exampleUser); + var exampleUser = idIndex.Find(357); + exampleUser.DogCount += 5; + idIndex.Update(exampleUser); var usernameIndex = ctx.Db.user.Username; - usernameIndex.delete("Evil Bob"); + usernameIndex.Delete("Evil Bob"); } } ``` From d23148704a8da901f8e3e96ef5b1e77fb486939a Mon Sep 17 00:00:00 2001 From: Phoebe Goldman Date: Wed, 7 May 2025 17:41:42 -0400 Subject: [PATCH 2/2] Read `.Value` Co-authored-by: james gilles --- docs/modules/c-sharp/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/modules/c-sharp/index.md b/docs/modules/c-sharp/index.md index 1c02ac18..868aa172 100644 --- a/docs/modules/c-sharp/index.md +++ b/docs/modules/c-sharp/index.md @@ -480,7 +480,7 @@ public static partial class Module { [Reducer] void Demo(ReducerContext ctx) { var idIndex = ctx.Db.user.Id; - var exampleUser = idIndex.Find(357); + var exampleUser = idIndex.Find(357).Value; exampleUser.DogCount += 5; idIndex.Update(exampleUser);