Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,BirthDate,PhoneNumber")] Cliente cliente)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cliente);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Procedimentos procedimentos)
        {
            if (ModelState.IsValid)
            {
                _context.Add(procedimentos);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(procedimentos));
        }
Ejemplo n.º 3
0
 public async Task InsertAsync(Servico obj)
 {
     _context.Add(obj);
     await _context.SaveChangesAsync();
 }