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
ahmed elbarbary
NA
1.6k
276.1k
How to represent create new employee record by web API ?
Feb 15 2019 7:34 PM
Problem
How to represent create new employee record by web API ?
i work on project asp.net core 2.1
i create mvc controller employee controller and inside it i make create action result for create new employee view with
get type
and show last record exist on database plus one as below :
public IActionResult Create()
{
var
model
=
new
Employee();
if (
id
== null)
{
model.EmployeeId
=
_repository
.GetAll().Max(
Employee
=
>
Employee.EmployeeId) + 1;
}
return View(model);
}
I need to convert action result create to web API to connect to angular
so that
How to convert function action result create to web API ?
so that i create new web API controller :
[Produces("application/json")]
[Route("api/Employee")]
public class EmployeeController : Controller
{
//how to write code for create by using web api
}
view source
print?
Reply
Answers (
1
)
I have a website in which i want to have unlimited Language
CRUD operation in WCF Services with HTTP Request in ASP.Net