private void Salvar(bool Adicionar) { try { string json = new JavaScriptSerializer().Serialize(Lista); JSonRepository jr = new JSonRepository(); jr.Salvar(arquivo, json, Adicionar); } catch (Exception ex) { throw ex; } }
public List <Noticia> Listardados() { try { JSonRepository jr = new JSonRepository(); string texto = jr.Carregar(arquivo); List <Noticia> objNoticia = new List <Noticia>(); objNoticia = new JavaScriptSerializer().Deserialize <List <Noticia> >(texto); return(objNoticia); } catch (Exception ex) { throw ex; } }