Example #1
0
        public async Task <IHttpActionResult> Put(ChoiceControllerModel choice)
        {
            if (choice == null)
            {
                return(BadRequest());
            }
            var _choice = _mapper.Map <ChoiceControllerModel, IChoiceModel>(choice);
            var status  = await _choiceService.UpdateAsync(_choice);

            if (status != null)
            {
                return(Ok(_mapper.Map <IChoiceModel, ChoiceControllerModel>(status)));
            }
            else
            {
                return(NotFound());
            }
        }