// PUT: api/AppSystem/5 public async Task <HandleResult> Put(string id, [FromBody] UpdateAppSystemDto dto) { var command = new UpdateAppSystem(id, dto.Name, dto.ReMark); var result = await ExecuteCommandAsync(command); if (result.IsSuccess()) { return(HandleResult.FromSuccess("更新成功")); } return(HandleResult.FromFail(result.GetErrorMessage())); }
/// <summary>更新应用信息 /// </summary> public void Handle(ICommandContext context, UpdateAppSystem command) { var info = new AppSystemEditableInfo(command.Name, command.ReMark); context.Get <AppSystem>(command.AggregateRootId).Update(info); }