public IActionResult GetTransfers(long id)
 {
     try
     {
         return(Ok(_database
                   .EnumerateTransfers(id)
                   .Select(t => new
         {
             Id = t.TransferId,
             t.UserId,
             t.Amount
         })));
     }
     catch (InvalidOperationException)
     {
         return(NotFound("User not found."));
     }
 }
        public void TransferPointsTest()
        {
            var loyalty = new LoyaltyManager(_context);
            var user    = loyalty.CreateUser("George", "Orwell", "*****@*****.**");

            Assert.AreEqual(0, user.Points);

            var transfer    = loyalty.TransferPoints(user.UserId, 10);
            var queriedUser = loyalty.GetUser(user.UserId);

            Assert.AreEqual(10, user.Points);
            Assert.AreEqual(10, transfer.Amount);

            var queriedTransfer = loyalty.EnumerateTransfers(user.UserId).Last();

            Assert.AreEqual(transfer.TransferId, queriedTransfer.TransferId);
            Assert.AreEqual(10, queriedTransfer.Amount);
        }