Пример #1
0
        public async Task <IActionResult> Create([Bind("EventosId,NomeDoEvento,CapacidadeDoevento,QuantidadeDeIngressos,DataDoEvento,ValorDoIngresso,GeneroDoEvento,CasasDeShowId")] Eventos eventos)
        {
            if (ModelState.IsValid)
            {
                ViewBag.casa = _cacontext.CasasDeShow.ToList();
                _context.Add(eventos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CasasDeShowId"] = new SelectList(_context.Set <CasasDeShow>(), "CasasDeShowId", "CasasDeShowId", eventos.CasasDeShowId);
            return(View(eventos));
        }
Пример #2
0
 public void Adicionar(TEntity obj)
 {
     _eventosContexto.Add(obj);
     _eventosContexto.SaveChanges();
 }