//[Authorize] public async Task <IActionResult> Index() { List <Product> lstproducts; lstproducts = RedisConnector.Get <List <Product> >(User.Identity.Name + "lstProduct"); if (lstproducts == null) { lstproducts = await apiProxy.GetListAsync <Product>("product/GetAll"); //Saving a list to redis using object RedisConnector.Set(User.Identity.Name + "lstProduct", lstproducts); } if (User.Identity.IsAuthenticated) { ViewBag.Username = User.Identity.Name; List <string> lstClaims = new List <string>(); foreach (var claims in User.Claims) { lstClaims.Add(claims.Value); } } return(View(lstproducts)); }
public async Task <IActionResult> Index() { PatientViewModel objModel = new PatientViewModel(); List <AppointmentListDoctor> lstdoctor = RedisConnector.Get <List <AppointmentListDoctor> >(User.Identity.Name + "Appointmentlstdoctor"); if (lstdoctor == null) { lstdoctor = await apiProxy.GetListAsync <AppointmentListDoctor>("patient/GetDoctors"); //Saving a list to redis using object RedisConnector.Set(User.Identity.Name + "Appointmentlstdoctor", lstdoctor); } objModel.AvailableDoctors = lstdoctor; return(View(objModel)); }