What is the best way to handle long query strings in MVC?

I am working on an application that potentially has very long query strings to maintain state.

I'm not sure what the best way to handle these long lines of queries in action methods is because I will have a very long list of parameters.

Is it better to access the query string parameters directly from the query object or should I go further and create an action method with a very long list of parameters?

i.e. You must specify the configuration settings to customize the page. so we can have a query string as such :? rid = 123 & bid = 456 & cid = 789 & did = aaa & bg = 333 & f = 999 & .....

        public ActionResult AvailableTimes(int rid, int bid, int cid, string did, string bg, string f......)
        {
          // Do stuff
        }

or

public ActionResult AvailableTimes()
        {
          var query = Request.Query;
          // Do stuff
        }

Thanks in advance.

+3
source share
1

, . .

public ActionResult AvailableTimes(TimeItem time)
        {
          // Do stuff with time
        }
public Class TimeItem
{
    int rid { get; set; }
    int bid { get; set; }
    int cid { get; set; }
    string did { get; set; }
    string bg { get; set; }
} 
+5

All Articles