Ejemplo n.º 1
0
        public async Task <ActionResult> AddStadium(StadiumAddModel stadium)
        {
            if (ModelState.IsValid)
            {
                await stadiumService.Add(stadium);

                return(RedirectToAction("Index"));
            }
            else
            {
                StadiumModelWithCountries model = await stadiumService.GetStadiumWithCountries();

                return(View("Add", model));
            }
        }
Ejemplo n.º 2
0
        public async Task <IHttpActionResult> AddStadium(StadiumAddModel stadium)
        {
            if (!ModelState.IsValid)
            {
                return(this.InternalServerError());
            }
            try
            {
                await services.Add(stadium);

                return(Ok());
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }