DIX DESERIALIZZAZIONE
This commit is contained in:
@@ -27,6 +27,7 @@ else
|
||||
{
|
||||
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
|
||||
}
|
||||
//await InvokeAsync(StateHasChanged);
|
||||
// return base.OnAfterRenderAsync(firstRender);
|
||||
}
|
||||
protected MappaStatoExpl? CurrMSE { get; set; } = null;
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
<!-- Temporary workaround until MapRazorComponents supports AddAdditionalAssemblies -->
|
||||
<!-- Once that is implemented, the main project won't need to include this file -->
|
||||
<MP_TAB.Client.Pages.MachineDetail ></MP_TAB.Client.Pages.MachineDetail>
|
||||
<MP_TAB.Client.Pages.MachineDetail IdxMacc="@IdxMacc"></MP_TAB.Client.Pages.MachineDetail>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
[SupplyParameterFromQuery]
|
||||
[SupplyParameterFromQuery(Name = "IdxMacc")]
|
||||
public string? IdxMacc { get; set; }
|
||||
|
||||
|
||||
|
||||
@@ -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