TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Anjali Kumari
NA
163
20.9k
Update and Delete operation
Mar 6 2017 5:43 AM
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();
}
Reply
Answers (
6
)
how to calculate result based on formula using angular
Multiple ways of calling data from server to UI in angular2