Ejemplo n.º 1
0
            protected override async Task <CommandResult> HandleImpl(Command command)
            {
                State state = await documentStore.GetAsync <State>(command.Id);

                Aggregate aggregate = new Aggregate(state);

                aggregate.Categories.Add(command.Category);

                await documentStore.StoreAsync(aggregate.ToDocument());

                return(CommandResult.Void);
            }
Ejemplo n.º 2
0
            protected override async Task <CommandResult> HandleImpl(Command command)
            {
                State state = await documentStore.GetAsync <State>(command.Id);

                Aggregate aggregate = new Aggregate(state);

                aggregate.Markers.Delete(command.Name, command.Offset);

                await documentStore.StoreAsync(aggregate.ToDocument());

                return(CommandResult.Void);
            }
Ejemplo n.º 3
0
            protected override async Task <CommandResult> HandleImpl(
                Command command)
            {
                Aggregate item = new Aggregate(
                    command.Id,
                    command.Title,
                    command.Categories);

                await documentStore.StoreAsync(item.ToDocument());

                return(CommandResult.Void
                       .WithNotification(new AudioItemCreated
                {
                    Title = command.Title
                }));
            }