//[ValidateAntiForgeryToken] public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,AddressNation,AddressCity,AddressStreet,AddressState,PhoneNumber,PhoneNumberAlt,EmailAddress,EmailAddressAlt,Current")] UserContactData userContactData) { if (id != userContactData.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(userContactData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UserContactDataExists(userContactData.Id)) { return(NotFound()); } else { throw; } } return(Ok()); } return(new JsonResult(userContactData)); }
//[ValidateAntiForgeryToken] public async Task <IActionResult> Create([Bind("Id,UserId,AddressNation,AddressCity,AddressStreet,AddressState,PhoneNumber,PhoneNumberAlt,EmailAddress,EmailAddressAlt,Current")] UserContactData userContactData) { if (ModelState.IsValid) { _context.Add(userContactData); await _context.SaveChangesAsync(); return(Ok()); } return(new JsonResult(userContactData)); }