Replies: 4 comments 2 replies
-
Is your route being detected as an OData route? Check the |
Beta Was this translation helpful? Give feedback.
-
Also, does your method cause any side effects? It seems like it is a search, which wouldn't cause side effects, just return the results. In that case, I recommend using a bound function, instead of a bound action. Note that functions shouldn't cause side effects, and are accessed with GET and parameters in the URL. |
Beta Was this translation helpful? Give feedback.
-
@julealgon , I changed from a normal attribute directed routes to make them OData routes by adding bound actions to models. Yes, it is OData route now. But I saw it always null. I googled many solutions but nothing seems to close to my issue. For now I reverted my code and working. I shall take this up in my cooling period. |
Beta Was this translation helpful? Give feedback.
-
I had kept it for weekend. And after trying few things out... making it precise by removing all code inside, single parameters in action, I could pass the value, which worked fine. Came to know that the difference in parameter definitions(int while binding) and long(while accepting) was creating the problem. I could then add other things which I removed earlier and now it receives parameters as expected. As you told it might have been a small thing, which when rewritten had gone without my notice... but the param type is one which I noticed. Or I don't know if anything else did the trick because I tried out too many things. Again, Thanks for your time and support. |
Beta Was this translation helpful? Give feedback.
-
The action get hits with no parameter values
Tried in Postman with below Json Body
...api/v2/AFiles/Default.AStatus
{
"month" : 2,
"year" : 2022,
"key" : 5
}
and also with collection parameter.
Beta Was this translation helpful? Give feedback.
All reactions