本文整理汇总了C#中Request.GetParameter方法的典型用法代码示例。如果您正苦于以下问题:C# Request.GetParameter方法的具体用法?C# Request.GetParameter怎么用?C# Request.GetParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Request
的用法示例。
在下文中一共展示了Request.GetParameter方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Should_parse_query_params
public void Should_parse_query_params()
{
// given
var request = new Request("/foo", "foo=bar&multi=1&multi=2", "blabla", "whatever", new Dictionary<string, string>());
// then
Check.That(request.GetParameter("foo")).Contains("bar");
Check.That(request.GetParameter("multi")).Contains("1");
Check.That(request.GetParameter("multi")).Contains("2");
}
示例2: Should_handle_empty_query
public void Should_handle_empty_query()
{
// given
var request = new Request("/foo", "", "blabla", "whatever", new Dictionary<string, string>());
// then
Check.That(request.GetParameter("foo")).IsEmpty();
}
示例3: process
public void process(Request request)
{
string parentDepartment = request.GetParameter<string>("DepartnameName");
//this.repository.get_all_sub_departments() ;
reponse_engine.handle(repository.get_all_sub_departments(parentDepartment));
}