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 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();
}

Anjali Kumari152 reputationPosted Mar 6, 2017, 1:29 AM EST
Chetan RanpariyaRank #1,852 · 801 reputationPosted Mar 6, 2017, 1:35 AM EST
Anjali Kumari152 reputationPosted Mar 6, 2017, 2:42 AM EST
Anjali Kumari152 reputationPosted Mar 6, 2017, 2:43 AM EST
Chetan RanpariyaRank #1,852 · 801 reputationPosted Mar 6, 2017, 4:06 AM EST
http://www.c-sharpcorner.com/UploadFile/65794e/web-api-with-angular-js/
Chetan RanpariyaRank #1,852 · 801 reputationPosted Mar 6, 2017, 12:50 AM EST