Ejemplo n.º 1
0
        public void Handle(ChangedToDoItemDescriptionEvent @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.Description     = @event.Description;
                    db.Entry(item).State = EntityState.Modified;
                    db.SaveChanges();

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