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)); } }
public async Task <ActionResult> Create(CreateGenderInput input) { await _genderAppService.Create(input); return(RedirectToAction("Index")); }