Exercise - Cached

  1. In CalcOrderTotalForShipper add Debug.WriteLine to the class constructor.
  2. Save changes to Git.
  3. Build and test. (notice that every time you change shipper in the ShowShippers the Debug line of the constructor show in the output)
  4. In ShowShippers change the call to CalcOrderTotalForShipper, and use Cached<>.
  5. Save changes to Git.
  6. Build and test, notice :
    1. You get the same data for all rows.
    2. The Debug message for the constructor Appears only once.
  7. In CalcOrderTotalForShipper Clear the Where and Zero the value of the two local variables.
  8. Save changes to Git.
  9. Build and test.

Help us improve, Edit this page on GitHub
or email us at info@fireflymigration.com