/// <summary>
        /// No utilizado - Función de ejemplo
        /// Devuelve todas las mujeres de un archivo de json en forma de lista.
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <Humano> GetAllMujeresJSON()
        {
            var textJSON = (new HombreRepository()).GetAllJson();

            if (string.IsNullOrEmpty(textJSON))
            {
                return(null);
            }

            IEnumerable <Humano> ListaHombres = JsonService.Deserializar <IEnumerable <Mujer> >(textJSON);

            return(ListaHombres);
        }
Beispiel #2
0
        /// <summary>
        /// Devuelve todos los humanos de un archivo de json en forma de lista.
        /// </summary>
        /// <returns></returns>
        public static IEnumerable <Humano> GetAllHombresJSON()
        {
            var textJSON = (new HumanoRepository()).GetAllJson();

            if (string.IsNullOrEmpty(textJSON))
            {
                return(null);
            }

            try
            {
                return(JsonService.Deserializar <IEnumerable <Humano> >(textJSON));
            }
            catch (System.Exception)
            {
                return(new List <Humano>());
            }
        }
Beispiel #3
0
        internal static async Task <bool> GenerarHumanoJSON(object data)
        {
            string strJSON = JsonService.Generar(data);

            return(await(new HumanoRepository()).GenerarHumanoJSON(strJSON));
        }