Ejemplo n.º 1
0
        void IJobAdsCommand.TransferJobAd(Guid toPosterId, JobAdEntry jobAd)
        {
            if (toPosterId == jobAd.PosterId)
            {
                return;
            }
            if (!CanBeTransferred(jobAd))
            {
                throw new InvalidOperationException(string.Format("Cannot transfer the '{0}' job ad.", jobAd.Id));
            }

            _repository.TransferJobAd(toPosterId, jobAd.Id);
            jobAd.PosterId = toPosterId;
        }