public IHttpActionResult CreateNewList(CreateTodoListCommandModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { Worker.CreateToDoList(model); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public void CreateToDoList(CreateTodoListCommandModel model) { bus.Send <CreateToDoListCommand>(new CreateToDoListCommand(model.Id, model.Title, model.Description)); }