Example #1
0
        public IHttpActionResult ChangeDescription(ChangeTodoListDescriptionCommandModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                Worker.ChangeToDoListDescription(model);
                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
        public void ChangeToDoListDescription(ChangeTodoListDescriptionCommandModel model)
        {
            string todoListId = database.IdMaps.GetAggregateId <ToDoList>(int.Parse(model.Id)).ToString();

            bus.Send <ChangeToDoListDescriptionCommand>(new ChangeToDoListDescriptionCommand(todoListId, model.Description));
        }