예제 #1
0
        public async Task <IActionResult> SaveArea(CreateArea createArea)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    await _areaRepository.CreateArea(_mapper.Map <Area>(createArea));

                    return(RedirectToAction(nameof(Index)));
                }
            } catch (Exception)
            {
                return(BadRequest());
            }

            return(View("NewArea", createArea));
        }