DIX DESERIALIZZAZIONE
This commit is contained in:
@@ -8,6 +8,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MP.Data.Services
|
||||
@@ -396,7 +397,7 @@ namespace MP.Data.Services
|
||||
{
|
||||
foreach (var item in currListMSE)
|
||||
{
|
||||
string serVal = Newtonsoft.Json.JsonConvert.SerializeObject(item);
|
||||
string serVal = JsonSerializer.Serialize(item);
|
||||
await localStorage.SetItemAsync(machineMse(item.IdxMacchina), serVal);
|
||||
}
|
||||
}
|
||||
@@ -408,7 +409,13 @@ namespace MP.Data.Services
|
||||
/// <returns></returns>
|
||||
public async Task<MappaStatoExpl> GetMachineMse(string idxMacchina)
|
||||
{
|
||||
MappaStatoExpl answ = await localStorage.GetItemAsync<MappaStatoExpl>(machineMse(idxMacchina));
|
||||
MappaStatoExpl answ = new MappaStatoExpl();
|
||||
//answ = await localStorage.GetItemAsync<MappaStatoExpl>(machineMse(idxMacchina));
|
||||
string tryString = await localStorage.GetItemAsync<string>(machineMse(idxMacchina));
|
||||
if(tryString != "")
|
||||
{
|
||||
answ = JsonSerializer.Deserialize<MappaStatoExpl>(tryString);
|
||||
}
|
||||
return answ;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user