Exemplo n.º 1
0
        public IHttpActionResult CreateGender(GenderModel genderModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var genderDto = Mapper.Map <GenderDto>(genderModel);

                _genderAppService.Create(genderDto, AuthHelper.GetCurrentUserId());

                return(Ok("Gender Created"));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult> Create(CreateGenderInput input)
        {
            await _genderAppService.Create(input);

            return(RedirectToAction("Index"));
        }