public void Handle(CreateCommand command) { if (_repository.Exists(command.Id)) { throw new InvalidOperationException($"قبلا آگهی با شناسه {command.Id} ثبت شده است."); } var advertisement = new Advertisement(command.Id, UserId.FromGuid(command.OwnerId)); _repository.Add(advertisement); _unitOfWork.Commit(); }