示例#1
0
 public void Handle(ChangedToDoItemImportanceEvent @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.Importance      = @event.Importance;
             db.Entry(item).State = EntityState.Modified;
             db.SaveChanges();
         }
     }
 }
示例#2
0
 void Apply(ChangedToDoItemImportanceEvent @event)
 {
     Importance = @event.Importance;
 }
示例#3
0
 void Apply(ChangedToDoItemImportanceEvent @event)
 {
     Importance = @event.Importance;
 }