Example #1
0
        public async Task <ActionResult> DeleteChoice(Guid choiceID)
        {
            var choice = await _choiceService.GetByIdAsync(choiceID);

            bool b = await _choiceService.DeleteAsync(choice);

            return(RedirectToAction("ListChoices", "LoggedIn", new { page = Session["page"] }));
        }
Example #2
0
        public async Task <IHttpActionResult> Delete(ChoiceControllerModel choice)
        {
            if (choice == null)
            {
                return(BadRequest());
            }
            var _choice = _mapper.Map <ChoiceControllerModel, IChoiceModel>(choice);
            var status  = await _choiceService.DeleteAsync(_choice);

            if (status)
            {
                return(Ok());
            }
            else
            {
                return(NotFound());
            }
        }