ASP.NET route with arbitrary number of key-value pairs - is it possible?

前端 未结 2 1574
孤城傲影
孤城傲影 2021-01-13 12:35

I\'d like to handle URLs like this:

/Id/Key1/Value1/Key2/Value2/Key3/Value3/

Right now, I have set up a rule like this:

/{i         


        
2条回答
  •  暖寄归人
    2021-01-13 13:04

    Write your own model binder for a specialized dictionary. If you will have one there will be no need for parsing the string in each action method.

提交回复
热议问题