public RegionCollections(string json) { DataContractJsonSerializer serializador = new DataContractJsonSerializer(typeof(RegionCollections)); MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(json)); RegionCollections list = (RegionCollections)serializador.ReadObject(stream); this.AddRange(list); }
private RegionCollections GenerarListado(List <DALC.REGION> listaDALC) { RegionCollections lista = new RegionCollections(); foreach (var item in listaDALC) { Region r = new Region(); r.IdRegion = (int)item.ID_REGION; r.Nombre = item.NOMBRE; lista.Add(r); } return(lista); }