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