Get, Post methods are working, but I’m going to run the Put and Delete request then I face an error message.
Complete Project Url : https://github.com/Dushyantsingh-ds/dotnet-issues/blob/main/Projects/EmployeeService/Readme.md
Get, Post methods are working, but I’m going to run the Put and Delete request then I face an error message.
Complete Project Url : https://github.com/Dushyantsingh-ds/dotnet-issues/blob/main/Projects/EmployeeService/Readme.md
2
Answers
Your delete endpoint should also have a
[Route(...)]
data annotation:you have to decide what are you going to use – attribute routing or default routing from config file.
For today the most common way to use API is to assign attribute routing to the controller
you can use https//localhost:44350/api/employee/get for Get()
and so on
and since you don’t put methods as action attributes , you don’t need to use delete and put, you can use get and post instead.