title: How to resolve "Count = error CS0103: The name 'InnerExceptionCount' does not exist in the current context" from too many API requests
body: <p>I get this error whenever my Angular code executes the API get requests too many times within a few seconds and then I quickly change views.</p>
  
  <p>In my view page I have a "Call API" button to refresh the results by calling the API. If I quickly hit the button once or twice and then change the view I get this error. However if I hit the button quickly a few times then wait about 10 seconds then change the view, it doesn't happen. The more times I hit the "Call API" button, the more times the "AggregateException" error pops up.</p>
  
  <p>my code looks like this; </p>
  
  <pre><code>    [HttpGet("Bookings-All")]
      public JsonResult AllBookings()
      {
          AppUser user = _userManagerService.GetUserAsync(HttpContext.User).Result;
  
          IEnumerable&lt;Booking&gt; Bookings = _repoBooking.GetAll().OrderByDescending(d =&gt; d.BookingDateTime).ToList();
          return Json(listErrorMsg(AllBookings.Select(a =&gt; new
          {
              bookingId = a.BookingId,
              bookingDateTime = $"{a.BookingDateTime.ToString("HH:mm")} - {a.BookingDateTime.ToString("dd/MM/yyyy")} | {a.BookingDateTime.DayOfWeek}",
              projectId = a.ProjectId,
              toFix = a.ToFix,
              toOrder = a.ToOrder,
              toSpray = a.ToSpray,
              jobType = a.JobType,
              bookingStatus = a.BookingStatus,
              clientId = a.ClientId == null ? "" : a.ClientId,
              clientName = a.ClientId == null ? "" : $"{_userManagerService.FindByIdAsync(a.ClientId).Result.FirstName} {_userManagerService.FindByIdAsync(a.ClientId).Result.LastName}",
  
              clientPhone = a.ClientId == null ? "" : $"{_userManagerService.FindByIdAsync(a.ClientId).Result.PhoneNumber}",
  
              projectAddress = a.ProjectId.ToString() == null ? ""
              : $"{_repoProject.GetSingle(p =&gt; p.ProjectId == a.ProjectId).streetNumber} {_repoProject.GetSingle(p =&gt; p.ProjectId == a.ProjectId).streetName}"
          })));
      }
  </code></pre>
  
  <p>How should I go about fixing this? Would putting a limit on the amount of requests approx. every 5 seconds help? This is happening in my dev environment but also on my Azure hosted web app with a free subscription. Would this problem solve itself once I upgrade my account?</p>
  
  <p>I'll be putting a "cooldown" period between requests in my frontend with JS but also looking for a backend solution to prevent circumventing the front end code, I also suspect I may have problems with many users on the App at the same time. I appreciate any input, thanks.</p>