コード例 #1
0
        // DELETE: api/AppSystem/5
        public async Task <HandleResult> Delete(string id)
        {
            var useFlag = (int)UseFlag.Disabled;
            var command = new ChangeAppSystem(id, useFlag);
            var result  = await ExecuteCommandAsync(command);

            if (result.IsSuccess())
            {
                return(HandleResult.FromSuccess("删除成功"));
            }
            return(HandleResult.FromFail(result.GetErrorMessage()));
        }
コード例 #2
0
 /// <summary>删除应用系统
 /// </summary>
 public void Handle(ICommandContext context, ChangeAppSystem command)
 {
     context.Get <AppSystem>(command.AggregateRootId).Change(command.UseFlag);
 }