Craig100
08/25/2024, 9:18 PM[HttpPost]
// [Route("Users/DeleteUserNumber")]
public bool DeleteUserNumber([FromBody] string? id) {
bool returnState = false;
/*if (id != null && Convert.ToInt32(id) > 0) {
returnState = _UsersDataFunctions.DeleteUserNumber(id);
}*/
return returnState;
}
https://cdn.discordapp.com/attachments/1277376681082093590/1277376681606123591/image.png?ex=66ccf13d&is=66cb9fbd&hm=473618619eecaab457f1a6470c3b99f96124791dbf6597606460fd127f088cc5&D_Inventor
08/26/2024, 6:15 AMnull
, but I think you may be able to solve it in one of two ways:
*Option 1*: create a request model:
csharp
public class MyRequestModel
{
public string Id { get; set; }
}
public bool DeleteUserNumber([FromBody] MyRequestModel request)
{
// ... your code
}
*Option 2*: Don't send the payload as json, but directly.
Instead of sending this:
json
{id: "000000015"}
Send this:
000000015
Craig100
08/26/2024, 9:07 AMD_Inventor
08/26/2024, 11:57 AMD_Inventor
08/26/2024, 11:59 AM