Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Email")] Customer customer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customer));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Description")] Room room)
        {
            if (ModelState.IsValid)
            {
                _context.Add(room);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(room));
        }
Exemplo n.º 3
0
 public Customer Add(Customer entity)
 {
     db.Add(entity);
     db.SaveChanges();
     return(entity);
 }
Exemplo n.º 4
0
 public Room Add(Room entity)
 {
     db.Add(entity);
     db.SaveChanges();
     return(entity);
 }