-
Notifications
You must be signed in to change notification settings - Fork 32
Menus and Recipe Queues
Mike Christensen edited this page Aug 28, 2026
·
1 revision
Menus are named recipe collections. The queue is a simpler per-user holding area for recipes a user may want later. Both are persistent, identity-scoped DB features.
var created = await context.Menus.Create
.WithTitle("Weeknight dinners")
.AddRecipes(firstRecipeId, secondRecipeId)
.CommitAsync(cancellationToken);
var menu = Menu.FromId(created.NewMenuId.Value);
var loaded = await context.Menus
.Load(menu)
.WithRecipes
.ListAsync(cancellationToken);Update a menu by adding/removing recipes, renaming, clearing, or moving recipes to another menu:
await context.Menus
.Update(menu)
.AddRecipe(thirdRecipeId)
.Remove(Recipe.FromId(firstRecipeId))
.Rename("Fast dinners")
.CommitAsync(cancellationToken);Delete through context.Menus.Delete(menu).CommitAsync(...). A move can target selected recipes or all recipes; load or retain the involved menu identities before constructing it.
await context.Queue.Enqueue
.Recipe(firstRecipeId)
.Recipe(secondRecipeId)
.CommitAsync(cancellationToken);
var queued = await context.Queue.Load.ListAsync(cancellationToken);
await context.Queue.Dequeue
.Recipe(Recipe.FromId(firstRecipeId))
.CommitAsync(cancellationToken);
await context.Queue.Dequeue.All.CommitAsync(cancellationToken);The queue returns RecipeBrief values. Use recipe loading when full methods and ingredients are required.
- Require authentication before user-specific mutations.
- Use a stable
AuthIdentity.UserId; display names can change. - Check ownership at the application boundary as well as relying on identity-scoped adapter queries.
- Batch recipe IDs into one fluent operation.
- Menus and queues are optional product concepts. A public recipe browser or local-only sample does not need to expose them.
KitchenPC is MIT licensed. Runnable applications live in KitchenPC/Samples.