mrzackattack
mrzackattack
CC#
Created by mrzackattack on 2/14/2023 in #help
❔ ✅ Razor LocalStorage With Blazored.Localstorage Question
!close
5 replies
CC#
Created by mrzackattack on 2/14/2023 in #help
❔ ✅ Razor LocalStorage With Blazored.Localstorage Question
This is my function that gets data from localstorage
private async Task GetData()
{
var localStorageCount = await localStorage.GetItemAsync<string>("LocalDataDishes");
//parse localStorageCount into json format
jsonString = JsonConvert.SerializeObject(localStorageCount);

// Retrieve the values
JObject json = JObject.Parse(localStorageCount);
dishName = (string)json["dishname"];
count = (int)json["Count"];
id = (int)json["ID"];
dishDescription = (string)json["dishdiscription"];
}
private async Task GetData()
{
var localStorageCount = await localStorage.GetItemAsync<string>("LocalDataDishes");
//parse localStorageCount into json format
jsonString = JsonConvert.SerializeObject(localStorageCount);

// Retrieve the values
JObject json = JObject.Parse(localStorageCount);
dishName = (string)json["dishname"];
count = (int)json["Count"];
id = (int)json["ID"];
dishDescription = (string)json["dishdiscription"];
}
5 replies