Exemple #1
0
        public async Task Add(StadiumAddModel stadium)
        {
            await repository.Add(new KadabraStadium()
            {
                Description = stadium.Description,
                Name        = stadium.Name,
                Capacity    = stadium.Capacity,
                CountryId   = stadium.CountryId,
                Id          = Guid.NewGuid().ToString()
            });

            await repository.Save();
        }
Exemple #2
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));
            }
        }
Exemple #3
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));
            }
        }
        public async Task Add(StadiumAddModel stadium)
        {
            HttpResponseMessage response = await apiClient.PostAsJsonAsync("Kadabra/Stadium/AddStadium", stadium);

            response.EnsureSuccessStatusCode();
        }