Example #1
0
        public ActionResult GetProvinciasByPaisId(string paisId)
        {
            if (String.IsNullOrEmpty(paisId))
            {
                throw new ArgumentNullException("paisId");
            }
            int  id         = 0;
            bool isValid    = Int32.TryParse(paisId, out id);
            var  provincias = _repository.GetAllProvinciasByPaisId(id);

            var result = (from s in provincias
                          select new
            {
                id = s.Id,
                name = s.nombre
            }).ToList();

            return(Json(result, JsonRequestBehavior.AllowGet));
        }