コード例 #1
0
        public async Task <IActionResult> DeletCreditCard(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            var creditCard = await _context.CreditCard.SingleOrDefaultAsync(x => x.IdCard == id);

            _context.Remove(creditCard);
            _context.SaveChanges();
            return(RedirectToAction("CreditCardClient", new { idClient = creditCard.IdClient }));
        }
コード例 #2
0
 public void testCreateHotel([Bind("Stars,HotelName,DescriptionTable")] Hotels hotelPost)
 {
     context.Add(hotelPost);
     context.SaveChanges();
 }
コード例 #3
0
 public void CreateHotel(Hotels hotels)
 {
     context.Add(hotels);
     context.SaveChanges();
 }