Beispiel #1
0
        public async Task <IActionResult> PutCarts(int id, Carts carts)
        {
            if (id != carts.CartId)
            {
                return(BadRequest());
            }

            _context.Entry(carts).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CartsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        public async Task <IActionResult> PutAdmin(int id, Admin admin)
        {
            if (id != admin.AdminId)
            {
                return(BadRequest());
            }

            _context.Entry(admin).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!AdminExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <Customers> > PostCustomers(Customers customers)
        {
            var result = this.customerDomain.isLogin(customers);
            //_context.Admin.Add(admin);
            await _context.SaveChangesAsync();

            //return CreatedAtAction("GetAdmin", new { id = admin.AdminId }, admin);

            return(Ok(result));
        }
 public async Task <int> SaveChanges()
 {
     return(await Db.SaveChangesAsync());
 }