public async ValueTask Upsert(Node node, IDatabaseSession db, Func <Node, IDatabaseSession, ValueTask> next) { var store = db.GetPartition(node).Value; await store.UpsertNode(node); if (next != null) { throw new Exception("Next should be null for the that last writer middleware."); } }
public async ValueTask Delete(NodeID nodeId, IDatabaseSession db, Func <NodeID, IDatabaseSession, ValueTask> next) { var store = db.GetPartition(nodeId).Value; await store.DeleteNodeAsync(nodeId); if (next != null) { throw new Exception("Next should be null for the that last merge writer middleware."); } }
public async ValueTask <Node> Read(NodeID nodeId, IDatabaseSession db, Func <NodeID, IDatabaseSession, ValueTask <Node> > next) { return(await db.GetPartition(nodeId).Value.LoadNodeAsync(nodeId)); }