Beispiel #1
0
        // 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()));
        }
Beispiel #2
0
        /// <summary>更新应用信息
        /// </summary>
        public void Handle(ICommandContext context, UpdateAppSystem command)
        {
            var info = new AppSystemEditableInfo(command.Name, command.ReMark);

            context.Get <AppSystem>(command.AggregateRootId).Update(info);
        }