Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am trying to build this online food ordering app. while testing a HttpPost method in a controller using Postman, I am expecting a bool
I am trying to build this online food ordering app. while testing a HttpPost method in a controller using Postman, I am expecting a bool value of true, but keep getting the message that corresponds to it being false. this is my WebService Model. this is my DAL model using System; using System. Collections.Generic; \#nullable disable namespace OnlineFoodorderDALCrossPlatform. Models \{ public partial class Item \{ public Item() \{ Orders = new HashSet (); 3 public string ItemId { get; set; } public string ItemName { get; set; } public int CategoryId { get; set; } public decimal Price { get; set ;} public virtual Category Category { get; set; } public virtual ICollection Orders { get; iset;} \} 3 this is the corresponding method from my repository. And this is my method from my controller class. When I test in postman I should be getting back "Successful add of new Item" but keep getting "Failed to add new Item". I have tried a lot of different things with no luck. Any help would be great! this is what I am posting on postman by the way {"Price":19.99}"CategoryId":1,"ItemId":"abc123","ItemName":"MyItem
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started