public async Task <bool> Handle(DeleteCircleCommand request, CancellationToken cancellationToken) { var circle = await _circleRepository.GetCircleWithPostsAsync(request.Id); if (circle == null) { throw new ClientException("圈子不存在"); } var myId = Guid.Parse(_httpContextAccessor.HttpContext.User.FindFirst(ClaimTypes.NameIdentifier).Value); circle.Delete(myId); _circleRepository.Remove(circle); return(await _circleRepository.UnitOfWork.SaveEntitiesAsync(cancellationToken)); }