public IActionResult Put(int id, [FromBody] mynotes t4) { if (ModelState.IsValid) { bool result = irepoobj.putdata(id, t4); if (result) { return(Created($"/api/values/{t4.id}", t4)); } else { return(NotFound($"member with this {id} not found ")); } } else { return(BadRequest("Invalid entry")); } }
public IActionResult Post([FromBody] mynotes t3) { if (ModelState.IsValid) { bool result = irepoobj.postdata(t3); if (result) { return(Created($"/api/values/{t3.id}", t3)); } else { return(BadRequest("This data already exists.")); } } else { return(BadRequest("Invalid Format")); } }