本文整理汇总了C#中ReadOnlyDictionary.AssertNotNull方法的典型用法代码示例。如果您正苦于以下问题:C# ReadOnlyDictionary.AssertNotNull方法的具体用法?C# ReadOnlyDictionary.AssertNotNull怎么用?C# ReadOnlyDictionary.AssertNotNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReadOnlyDictionary
的用法示例。
在下文中一共展示了ReadOnlyDictionary.AssertNotNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlerContext
public HandlerContext(RestRequest request, ReadOnlyDictionary<String, String> env, MethodInfo code)
{
Request = request.AssertNotNull();
Env = env.AssertNotNull();
Code = code.AssertNotNull();
// todo:
// 1) allow to return void, json, string, byte[], stream and any other object (the latter will then be serialized to json)
// 2) allow non-statics
// 3) allow RestRequest, RestResponse, RestContext, RestHints, Query, RequestHeaders, ResponseHeaders, Cookies, dynamic/Json (Data), Stream (output stream), TextWriter (response)
// 4) allow config types
// 5) deserialize when binding
// 6) bind to fields as well
// 7) comprehensive logging
// 8) try to bind everything, rather than stop at first error
Debug.EnsureBlankLine();
Debug.WriteLine(" * Env: {0}", Env.Select(kvp => String.Format("{0} = {1}", kvp.Key, kvp.Value)).StringJoin());
Debug.WriteLine(" * Query: {0}", request.Query.Select(kvp => String.Format("{0} = {1}", kvp.Key, (String)kvp.Value)).StringJoin().Fluent(s => s.IsEmpty() ? "<empty>" : s));
Debug.WriteLine(" * Data: {0}", ((Json)request.Data).ToCompactString().Fluent(s => s.IsEmpty() ? "<empty>" : s));
// todo. after that log:
// Write(" * field foo <= ")
// do something, then write either:
// 1) WriteLine("Data.foo") or
// 2) WriteLine("FAIL") or even
// 3) exception.... [will be traced by RestGateway]
}