Beispiel #1
0
        public async Task Handle(Events.MarkedComplete e, IMessageHandlerContext ctx)
        {
            var existing = await ctx.UoW().Get <Models.TodoResponse>(e.TodoId);

            await ctx.UoW().Update(e.TodoId, new Models.TodoResponse
            {
                Id      = e.TodoId,
                Message = existing.Message,
                Active  = false
            }).ConfigureAwait(false);
        }
        public Task Handle(Events.MarkedComplete e, IMessageHandlerContext ctx)
        {
            Models.TodoResponse model;
            if (!MemoryDB.TryGetValue(e.TodoId, out model))
            {
                throw new InvalidOperationException($"Todo {e.TodoId} doesn't exist");
            }

            model.Active = false;
            return(Task.CompletedTask);
        }
Beispiel #3
0
 private void Handle(Events.MarkedComplete e)
 {
     this.Active = false;
 }