コード例 #1
0
        public void Handle(MarkedToDoItemAsCompletedEvent @event)
        {
            using (var db = new ToDoContext())
            {
                int      itemId = _identityMapper.GetModelId <ToDoItem>(@event.Id);
                ToDoItem item   = db.Items.First(t => t.Id.Equals(itemId));
                if (item != null)
                {
                    item.ClosingDate     = @event.ClosingDate;
                    db.Entry(item).State = EntityState.Modified;
                    db.SaveChanges();

                    Task.Run(() => notifier.MarkedToDoItemAsCompletedEventNotify(item)).ConfigureAwait(false);
                }
            }
        }