Ejemplo n.º 1
0
        public async Task <IActionResult> PutCustomerMaster(string id, CustomerMaster customerMaster)
        {
            if (id != customerMaster.CustCd)
            {
                return(BadRequest());
            }

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

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

            return(NoContent());
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <CustomerMaster> > PostCustomerMaster(CustomerMaster customerMaster)
        {
            _context.CustomerMaster.Add(customerMaster);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (CustomerMasterExists(customerMaster.CustCd))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetCustomerMaster", new { id = customerMaster.CustCd }, customerMaster));
        }