public async Task <IActionResult> Create([Bind("CourseID,Name")] Course course) { if (ModelState.IsValid) { _context.Add(course); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(course)); }
public async Task <IActionResult> Create([Bind("Id,Apelido,Email")] Usuario usuario) { if (ModelState.IsValid) { _context.Add(usuario); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(usuario)); }
public async Task <IActionResult> Create([Bind("StudentID,Name")] Student student) { if (ModelState.IsValid) { _context.Add(student); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(student)); }
public async Task <IActionResult> Create([Bind("EstadoId,Nome,Uf")] Estado estado) { if (ModelState.IsValid) { _context.Add(estado); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(estado)); }
public async Task <IActionResult> Create([Bind("ClienteId,Nome,Cpf,Telefone,Referencia")] Cliente cliente) { if (ModelState.IsValid) { _context.Add(cliente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cliente)); }
public async Task <IActionResult> Create([Bind("EnderecoId,Rua,NumeroDaCasa,Bairro,Cep")] Endereco endereco) { if (ModelState.IsValid) { _context.Add(endereco); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(endereco)); }
public async Task <IActionResult> Create([Bind("Id")] Review review) { if (ModelState.IsValid) { _context.Add(review); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(review)); }
public IActionResult Edite(User userChanges) { var currentUser = db.Users.Where(u => u.Id == currentUserId).Last(); currentUser.FirstName = userChanges.FirstName; currentUser.LastName = userChanges.LastName; currentUser.Email = userChanges.Email; db.Users.Update(currentUser); db.SaveChangesAsync(); var user = db.Users.Where(us => us.Id == currentUser.Id); return(RedirectToAction("Index")); }
public async Task CreateAsync(TipoUsuario tu) { tu.Ativo = true; await _context.TipoUsuarios.AddAsync(tu); await _context.SaveChangesAsync(); }
public async Task CreateAsync(Plataforma plataforma) { await _context.Plataformas.AddAsync(plataforma); await _context.SaveChangesAsync(); }
public async Task CreateAsync(Desenvolvedora desenvolvedora) { await _context.Desenvolvedoras.AddAsync(desenvolvedora); await _context.SaveChangesAsync(); }
public async Task CreateAsync(Diretor diretor) { await _context.Diretores.AddAsync(diretor); await _context.SaveChangesAsync(); }
public async Task <IActionResult> CreateCanton(VirtualCanton virtualCanton) { virtualCanton.Id = db.VirtualCantons.Count() + (new Random()).Next(10, 100000); db.Entry(virtualCanton).State = EntityState.Added; db.VirtualCantons.Add(virtualCanton); await db.SaveChangesAsync(); return(RedirectToAction("Canton")); }
public IActionResult Create(VirtualCanton virtualCanton) { db.VirtualCantons.Add(virtualCanton); db.SaveChangesAsync(); return(RedirectToAction("Privacy")); }
public virtual async Task CommitAsync() { await _context.SaveChangesAsync(); }
public async Task CreateAsync(Genero genero) { await _context.Generos.AddAsync(genero); await _context.SaveChangesAsync(); }
public IActionResult Create(VirtualDistrict virtualDistrict) { db.VirtualDistricts.Add(virtualDistrict); db.SaveChangesAsync(); return(RedirectToAction("Privacy")); }
public async Task CreateAsync(Classificacao classificacao) { await _context.Classificacoes.AddAsync(classificacao); await _context.SaveChangesAsync(); }
public async Task CommitAsync() { await _aplicationContext.SaveChangesAsync(); }
public async Task CreateAsync(ModoJogo modoJogo) { await _context.ModoJogos.AddAsync(modoJogo); await _context.SaveChangesAsync(); }