Slicing a FormCollection by keys that start with a certain string

前端 未结 2 1689
感情败类
感情败类 2021-01-12 07:42

Is there a nice linqy way of splitting a FormCollection into a Dictionary that contains only those keys that start wi

2条回答
  •  春和景丽
    2021-01-12 08:25

    [HttpPost]
    public ActionResult Index(FormCollection collection)
    {
         Dictionary form = new Dictionary();
         collection.CopyTo(form);
         return View();
    }
    

提交回复
热议问题