asp.net mvc - Change the querystring pattern of web api -
if put variable (say myvariable
) in action method such as
[routeprefix("api/myservice")] public class myapicontroller : apicontroller { [route("")] [httpget] public httpresponsemessage getvar([fromuri] string myvariable = "") { var response = request.createresponse(httpstatuscode.ok, ""); return response; }
} , api's url like: api/myservice?myvariable={ myvariable }
but want see like: api/myservice?myvariable={ var }
var
or else rather myvariable
.
how can without changing route table?
Comments
Post a Comment