public async Task <BaseApiResponse> Delete(DeleteRequest request)
        {
            request.CheckNotNull(nameof(request));
            //判断
            var offlineStore = _offlineStoreQueryService.Info(request.Id);

            if (offlineStore == null)
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "没找到该店铺"
                });
            }
            //删除
            var command = new DeleteOfflineStoreCommand(request.Id);
            var result  = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "命令没有执行成功:{0}".FormatWith(result.GetErrorMessage())
                });
            }

            //添加操作记录
            var currentAdmin = _contextService.GetCurrentAdmin(HttpContext.Current);

            RecordOperat(currentAdmin.AdminId.ToGuid(), "删除线下店铺", request.Id, offlineStore.Name);

            return(new BaseApiResponse());
        }
        public async Task <BaseApiResponse> Delete([FromBody] DeleteRequest request)
        {
            request.CheckNotNull(nameof(request));
            //判断
            var offlineStore = _offlineStoreQueryService.Info(request.Id);

            if (offlineStore == null)
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "没找到该店铺"
                });
            }
            //删除
            var command = new DeleteOfflineStoreCommand(request.Id);
            var result  = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(new BaseApiResponse {
                    Code = 400, Message = "命令没有执行成功:{0}".FormatWith(result.GetErrorMessage())
                });
            }
            return(new BaseApiResponse());
        }
 public void Handle(ICommandContext context, DeleteOfflineStoreCommand command)
 {
     context.Get <OfflineStore>(command.AggregateRootId).Delete();
 }