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();
}
Chetan RanpariyaPosted Mar 6, 2017, 9:06 AM
http://www.c-sharpcorner.com/UploadFile/65794e/web-api-with-angular-js/
Anjali KumariPosted Mar 6, 2017, 7:43 AM
Anjali KumariPosted Mar 6, 2017, 7:42 AM
Chetan RanpariyaPosted Mar 6, 2017, 6:35 AM
Anjali KumariPosted Mar 6, 2017, 6:29 AM
Chetan RanpariyaPosted Mar 6, 2017, 5:50 AM