Exemple #1
0
        public IHttpActionResult GetAllcountries()
        {
            IList <Country> countries = anonymousUserFacade.GetAllCountries();

            if (countries.Count == 0)
            {
                return(NotFound());
            }
            return(Ok(countries));
        }
        public IHttpActionResult GetAllCountries()
        {
            IHttpActionResult result = controllersCenter.ExecuteSafe(() =>
            {
                IList <Country> countries = facade.GetAllCountries();
                if (countries.Count < 1)
                {
                    return(Content(HttpStatusCode.NoContent, "Sorry, But No Countries Have Been Added To The Site Yet."));
                }
                return(Content(HttpStatusCode.OK, countries));
            });

            return(result); // for debug - break point here
        }
Exemple #3
0
        public IActionResult GetAllCountries()
        {
            IActionResult result = SafeExecute(() =>
            {
                IList <Country> countries = AnonymousUserFacade.GetAllCountries();
                if (countries.Count < 1)
                {
                    return(NoContent());
                }
                return(Ok(countries));
            });

            return(result);
        }
        public IHttpActionResult GetAllCountries()
        {
            List <Country> AllCountries = AnonymousFacade.GetAllCountries().ToList();

            if (AllCountries.Count == 0)
            {
                return(NotFound());
            }

            else
            {
                return(Ok(AllCountries));
            }
        }
Exemple #5
0
        public IHttpActionResult GetAllCountries()
        {
            IList <Country> countries = facade.GetAllCountries();

            return(Ok(countries));
        }