public async Task <ActionResult <FriendsDetails> > PostFriendsDetails(FriendsDetails friendsDetails) { _context.FriendsDetails.Add(friendsDetails); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFriendsDetails", new { id = friendsDetails.DetailsId }, friendsDetails)); }
public async Task <IActionResult> PutFriendsDetails(int id, FriendsDetails friendsDetails) { if (id != friendsDetails.DetailsId) { return(BadRequest()); } _context.Entry(friendsDetails).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FriendsDetailsExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }