I can't transfer data from controller to query file
Stack Overflow
I can't transfer data from controller to query file
Hello I can get every data but I can't get the ProductIds, it gives me null in the Handle functions request parameter. SelectedIds is not null, I can get it without problem in my action. I hope som...
14 Replies
It's really not clear what your question/problem is
Is MediatR relevant to the question btw? We can't really tell
if you put a breakpoint in
EmployeeSessionPost
. Is selectedIds
null?as I mentioned in the post, I don't get selectedIds null, I can get my data. I mentioned everything necessary. Mediatr is not relevant the question.
I can declare other variables without problem. Only the ProductIds is become null in the handle function. I couln't find anything in debugging
That would mean MediatR is malfunctioning right? You give it a Query with a list of ints, and the Handle method doesn't receive the list of ints?
I tought the same but in all of the other areas in the project, mediatr is working fine
also in here as well, because I can retrieve the other datas
Yes ProductIds is null in handle
I think it's unlikely too. Try debugging again to make really sure
when I get in here selectedIds become null as well
I see it now
but I can get the data when I trigger the action, it is reachable
here as you can see
and the 2nd time, does the query get the selected ids?
ow okay I see
I noticed now, my action getting triger twice
don't know why, I will check. After the second trigger It makes the selectedIds = 0
Hey, I edited my stackoverflow link. Can you check it one more time. Here is the result of all my debugging
I hope you can help
your
<form>
has an action which posts to your endpoint, but also $('#btnUpdate').on('click'
posts to your endpoint
I think both these things are making a separate call
find out which one is the one that works and remove the other :)Yeah, I was thinking the same but without using EmployeeSessionPost as action parameter I can't get the data
I can't make it POST request without not using any button. So I had to have the button.
But also I can't get the data without the EmployeeSessionPost, without using it in the UrlAction
hmm I don't know which one to keep and which one to throw away. I haven't used razor in a while
hmm okay I understand
I fixed the problem if you interest you can check it from the given stackoverflow link