-
Notifications
You must be signed in to change notification settings - Fork 644
Open
Labels
bugSomething isn't workingSomething isn't working
Description
DESCRIPTION
When building a C# server module using a namespace for the Module the return value for any defined Views will be mangled in the FFI.cs.
EXAMPLE
using SpacetimeDB;
namespace Test;
public static partial class Module
{
[SpacetimeDB.Table]
public partial struct Person
{
[SpacetimeDB.AutoInc]
[SpacetimeDB.PrimaryKey]
public int Id;
public string Name;
public int Age;
}
[SpacetimeDB.View(Name = "MyPerson", Public = true)]
public static Person? MyPerson(ViewContext ctx) =>
ctx.Db.Person.Id.Find(0);
[SpacetimeDB.Reducer]
public static void Add(ReducerContext ctx, string name, int age)
{
var person = ctx.Db.Person.Insert(new Person { Name = name, Age = age });
Log.Info($"Inserted {person.Name} under #{person.Id}");
}
[SpacetimeDB.Reducer]
public static void SayHello(ReducerContext ctx)
{
foreach (var person in ctx.Db.Person.Iter())
{
Log.Info($"Hello, {person.Name}!");
}
Log.Info("Hello, World!");
}
}TODO
- Repair the codegen to properly parse the type for ReturnType on ViewDispatcher
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working