Esempio n. 1
0
        public async Task <IActionResult> Edit([FromRoute] int id, [FromBody] customerprofileTemp customerprofile)
        {
            var customerprofileTuple = await _context.customerprofile.SingleOrDefaultAsync(m => m.CustomerProfileID == id);

            if (customerprofileTuple == null)
            {
                return(NotFound());
            }
            customerprofileTuple.Name        = customerprofile.Name;
            customerprofileTuple.Address     = customerprofile.Address;
            customerprofileTuple.PhoneNumber = customerprofile.PhoneNumber;
            customerprofileTuple.DateOfBirth = customerprofile.DateOfBirth;
            _context.Update(customerprofileTuple);
            _context.SaveChanges();
            return(Ok(customerprofile));
        }