protected async static Task SaveData(string DataFileName, T Favourites) { var AFS = new AppFileService(); var Text = JsonConvert.SerializeObject(Favourites); await AFS.CreateOrReplaceFile(DataFileName, Text); }
protected async static Task <T> LoadData(string DataFileName) { var AFS = new AppFileService(); var Text = await AFS.ReadFile(DataFileName); if (Text == null) { return(default(T)); } return(JsonConvert.DeserializeObject <T>(Text)); }
protected async static Task ClearData(string DataFileName) { var AFS = new AppFileService(); await AFS.DeleteFile(DataFileName); }