public async Task <IActionResult> PutBPedigree([FromRoute] int id, [FromBody] BPedigree bPedigree) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != bPedigree.Id) { return(BadRequest()); } _context.Entry(bPedigree).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BPedigreeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <IActionResult> PostBPedigree([FromBody] BPedigree bPedigree) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } _context.BPedigree.Add(bPedigree); await _context.SaveChangesAsync(); return(CreatedAtAction("GetBPedigree", new { id = bPedigree.Id }, bPedigree)); }