示例#1
0
        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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));
        }
示例#4
0
 public void Add(VotedUUID vote)
 {
     _ctx.Add(vote);
 }
示例#5
0
 public void Add(Strawpoll poll)
 {
     _ctx.Add(poll);
 }
示例#6
0
 public void Add(Answer answer)
 {
     _ctx.Add(answer);
 }