コード例 #1
0
        public async Task <ActionResult <dtInvVoucherEntry> > PostdtInvVoucherEntry(dtInvVoucherEntry dtInvVoucherEntry)
        {
            _context.dtInvVoucherEntry.Add(dtInvVoucherEntry);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetdtInvVoucherEntry", new { id = dtInvVoucherEntry.ID }, dtInvVoucherEntry));
        }
コード例 #2
0
        public async Task <IActionResult> PutdtInvVoucherEntry(long id, dtInvVoucherEntry dtInvVoucherEntry)
        {
            if (id != dtInvVoucherEntry.ID)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }