public IActionResult OnPostAddFriend(string username) { if (HttpContext.Session.GetString("user") != null) { customer = Newtonsoft.Json.JsonConvert.DeserializeObject <Customer>(HttpContext.Session.GetString("user")); _customerHandler.AddFriend(customer.Id, username); } return(RedirectToPage()); }