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
vijayaasri palaniappan
NA
117
10.1k
In WebAPI, [FromUri] and [FromBody]
May 17 2021 9:29 AM
Hi,
In WebAPI, I pass the Id as the [FromBody]
{
"Id" : 1
} in JSOn Format.
and Employee as the [FormUri] for the PUT method. It Shows the error:
"Message": "The request is invalid.",
"MessageDetail": "The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Net.Http.HttpResponseMessage Put(Int32, EmployeeDataAccess.Employee)' in 'WebAPI.Controllers.EmployeesController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter."
And when I give ID as the [FromUri] and Employee as the [FormBody]. It Updated Successfully.Pls share Your Idea.
Thanks in Advance.
Reply
Answers (
4
)
How can i get multile record in web api
Login Google, Database side