public IHttpActionResult ChangeDescription(ChangeToDoItemDescriptionModel model) { if (!ModelState.IsValid) return BadRequest(ModelState); try { Worker.ChangeDescription(model); return Ok(); } catch (Exception ex) { return BadRequest(ex.Message); } }
public void ChangeDescription(ChangeToDoItemDescriptionModel model) { string todoItemId = database.IdMaps.GetAggregateId<ToDoItem>(int.Parse(model.Id)).ToString(); bus.Send<ChangeToDoItemDescriptionCommand>(new ChangeToDoItemDescriptionCommand(todoItemId, model.Description)); }