コード例 #1
0
        void IDonationsCommand.CreateRequest(DonationRequest request)
        {
            // Try to find first.

            var existingRequest = _repository.GetRequest(request.RecipientId, request.Amount);

            if (existingRequest == null)
            {
                request.Prepare();
                _repository.CreateRequest(request);
            }
            else
            {
                request.Id = existingRequest.Id;
            }
        }