I am using xamarin.forms. I am trying to insert data in caches.
var getData = JsonConvert.DeserializeObject<UserViewModel>(Respone);
await BlobCache.LocalMachine.InsertObject("RsponseData",getData);
And then I try to get cached data.
var data = BlobCache.LocalMachine.GetObject<UserViewModel>("RsponseData");
How to to use data so that I can do:
data.UserName
data.password
Do not forget to use
await
when you try to get the cached data. Because you should wait inserting object done.var data =await BlobCache.LocalMachine.GetObject<UserViewModel>("RsponseData");
Try the following code:
You will get the output: