Porting MVC Music Store to Raven: Porting the checkout process
The checkout process in the MVC Music Store is composed of two parts, adding address & payment options and completing the order.
The old code for address & payment is on the left, the new on the right.
As you can see, they are quite similar. Raven’s code isn’t complete yet, though.
If you’ll recall, we stated that we are going to store the CountSold property inside the Album document, to allow us to easily sort by that count. We now need to write that logic, I put it directly after the call to CreateOrder:
It is important to note that we are loading all the albums document in a single query. And when we save, Raven is going to make a single (batched) call to the server.
And now, merely to completion sake (pun intended) let us look at the Complete method:
I think by now you can tell what is going on in each system. The next post will cover the administration section.
Comments
No comments posted yet.