Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Protected Local Storage is very slow

$
0
0

I have 13 parameters that when a user log in website will be set like this:

`ProtectedSessionStore.SetAsync("iduser", iduser);ProtectedSessionStore.SetAsync("unitid", unitid);ProtectedSessionStore.SetAsync("branchid", branchid);ProtectedSessionStore.SetAsync("organid", organid);ProtectedSessionStore.SetAsync("defuser", defuser);ProtectedSessionStore.SetAsync("defbranch", defbranch);ProtectedSessionStore.SetAsync("defunit", defunit);ProtectedSessionStore.SetAsync("defproduct", defproduct);ProtectedSessionStore.SetAsync("defpointofbody", defpointofbody);ProtectedSessionStore.SetAsync("defdegree", defdegree);ProtectedSessionStore.SetAsync("defvisit", defvisit);ProtectedSessionStore.SetAsync("defpatient", defpatient);ProtectedSessionStore.SetAsync("report", report);`

after login I want to have this values in 2 razor pages. One of the pages is my navmenu layout and the other one is mainmenu.so in both I have this code:

 var result = await ProtectedSessionStore.GetAsync<int>("iduser");iduser = result.Success ? result.Value : 0;result = await ProtectedSessionStore.GetAsync<int>("unitid");unitid = result.Success ? result.Value : 0;result = await ProtectedSessionStore.GetAsync<int>("branchid");branchid = result.Success ? result.Value : 0;result = await ProtectedSessionStore.GetAsync<int>("organid");organid = result.Success ? result.Value : 0;var result1 = await ProtectedSessionStore.GetAsync<bool>("defuser");defuser = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defbranch");defbranch = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defunit");defunit = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defvisit");defvisit = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defdegree");defdegree = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defpointofbody");defpointofbody = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defpatient");defpatient = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("defproduct");defproduct = result1.Success ? result1.Value : false;result1 = await ProtectedSessionStore.GetAsync<bool>("report");report = result1.Success ? result1.Value : false;

the problem is that it is very slow loading this parameters. How can I speed up this Process?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>