I wan to perform some Put and Delete opeartions using angular2 I tried the
syed shanu example for the Get operation similarly I want to perform some CRUD operations like Post,Put and Delete operations..Please provide the example using angular2
http://www.c-sharpcorner.com/article/create-our-first-asp-net-core-angular-2-starter-application-net-core-using-te/#ReadAndPostComment
the below method I used for Put operation...
[HttpPut("{id}")]
public async Task<IActionResult> Updateuser([FromRoute] int id, [FromBody] User users)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != users.Id)
{
return BadRequest();
}
_context.Entry(users).State = EntityState.Modified;
try
{
await _context.SaveChangesAsync();
}
catch (Exception ex)
{
ex.Message.ToString();
}
return NoContent();
}