public async Task <IActionResult> Create([Bind("Id,Created,ClosingTime")] Poll poll) { if (ModelState.IsValid) { poll.Id = Guid.NewGuid(); _context.Add(poll); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(poll)); }
public async Task <IActionResult> Create([Bind("Id,CreatedBy,Description,TotalVoteCount,disabled")] PollItem pollItem) { if (ModelState.IsValid) { pollItem.Id = Guid.NewGuid(); _context.Add(pollItem); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pollItem)); }
public async Task <IActionResult> Create([Bind("Id,Name,LunchUrl,StreetAddress,City,PostalCode")] Restaurant restaurant) { if (ModelState.IsValid) { restaurant.Id = Guid.NewGuid(); _context.Add(restaurant); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(restaurant)); }
public void Add(VotedUUID vote) { _ctx.Add(vote); }
public void Add(Strawpoll poll) { _ctx.Add(poll); }
public void Add(Answer answer) { _ctx.Add(answer); }