public static async Task <List <Utente> > deserializza() { string json = await LetturaFile.ReadAllTextAsync(filename); List <Utente> u = JsonConvert.DeserializeObject <List <Utente> >(json); return(u); }
private static async void riempiLista() { try { if (await LetturaFile.IsFileExistAsync("Utenti.json")) { utenti = await GestoreJson.deserializza(); } } catch (NullReferenceException) { } }
public static async Task Serializza(List <Utente> u) { string json = JsonConvert.SerializeObject(u, Formatting.Indented); await LetturaFile.WriteTextAllAsync(filename, json); }