ā Endpoints
hi š can anyone explain why 1 code works and scond no?
also there is third way, but how to get HttpContext here?
8 Replies
ok, i solved it by myself, wasn't working cuz
on the end
but still, which is better and conventional way to create endpoints?
The last one is best
There's no need to ever use
Request
and Response
Just bind the data you want to get, and return the data you want to return
Anything else is giving yourself more work than is necessary for no reason at all
Also, don't use Convert.ToInt32
, use int.TryParse()
Or better yet, with parameter binding... you can just get the integer in the first place
No need to convert anything forget i can just
yeah
Thanks again
š
Btw, If I understand it correctly, it should work something like this?
It can, yes