Exemple #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));
        }
Exemple #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));
        }
Exemple #3
0
 public Customer Add(Customer entity)
 {
     db.Add(entity);
     db.SaveChanges();
     return(entity);
 }
Exemple #4
0
 public Room Add(Room entity)
 {
     db.Add(entity);
     db.SaveChanges();
     return(entity);
 }