public async Task <IActionResult> AddToCart(int Id) { var user = await GetCurrentUserAsync(); var userId = user?.Id; if (userId == null) { return(Json("NotLoggedIn")); } else { bool added = _accountServices.AddToCart(Id, userId); return(Ok()); } }