C# in Controller pass in FormBody as parameter eg; CustomerDetails (inside got username…
Jump to turn (9)
- 1C# in Controller pass in FormBody as parameter eg; CustomerDetails (inside got u
- 2Can you show example in HttpPost Controller code?
- 3Can you show me example in ANgular UI side pass that JSON object of customerDeta
- 4const customerDetails = { "Username": "JohnDoe", "PhoneNo": "1234567890" }; So i
- 5So, hows the code in C# Controller side?
- 6HOw if my FromBOdy is from Database property names?
- 7So, this one is auto bind with Dabase Column name --> [Column("phone\no")] and [
- 8So, this [JsonProperty("username")] one, inside that "username" , that variable
- 9eg ; [JsonProperty("username")] , This one in my UI side i just give my JSON obj
- User
C# in Controller pass in FormBody as parameter eg; CustomerDetails (inside got username and phoneNO) but I want to pass as JSON object in my UI, is all the variables of my JSON object need to be the same with C# controller pamrameter variable name ? (both datatype and variable name is it need to be exactly the same ) Or Do you have any better solution can Deserialize the JSON object in backend side. As i always got NUll error for this kind of FomBOdy parameter when i want to send Object from UI to controller.
- Assistant