public AddPollViewModel() { Model = new AddPollModel(); Answers = new ObservableCollection <Answer>(); RemoveListItemCommand = new RelayCommand <Answer>(RemoveListItemAction); AddAnswerCommand = new RelayCommand(AddAnswerAction); PreviousCommand = new RelayCommand(PreviousAction, o => TransitionerIndex > 0 && TransitionerIndex < 3); NextCommand = new RelayCommand(NextAction, o => TransitionerIndex < 2); CreateCommand = new RelayCommand(CreateAction, o => ValidatePoll()); }
public ActionResult Add(AddPollModel anAddPollModel) { _pollRepository.AddPoll(new Poll() { Date = anAddPollModel.PollDate, Description = anAddPollModel.Description, Id = ObjectId.GenerateNewId(), Title = anAddPollModel.Title }); return(NoContent()); }