コード例 #1
0
        public ActionResult GetCountryData(string countryCode)
        {
            CountryMetricDetails model = null;

            using (var context = AppDbContext)
            {
                var results = GetCountriesData(context, countryCode);
                model = results.FirstOrDefault();
            }

            return(SerializeToJsonFormatted(model));
        }
コード例 #2
0
        public ActionResult Details(string countryCode)
        {
            // Just group all countries up by name, date (day)
            CountryMetricDetails model = null;

            using (var context = AppDbContext)
            {
                var results = GetCountriesData(context, countryCode);
                model = results.FirstOrDefault();
            }
            return(View(model));
        }