예제 #1
0
        public async Task <ActionResult <dtInvAccounts> > PostdtInvAccounts(dtInvAccounts dtInvAccounts)
        {
            _context.dtInvAccounts.Add(dtInvAccounts);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetdtInvAccounts", new { id = dtInvAccounts.ID }, dtInvAccounts));
        }
예제 #2
0
        public async Task <IActionResult> PutdtInvAccounts(int id, dtInvAccounts dtInvAccounts)
        {
            if (id != dtInvAccounts.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }