Add RequireNonNull

http://www.yinwang.org/blog-cn/2015/11/21/programming-philosophy
This commit is contained in:
bao-qian
2016-04-22 23:29:38 +01:00
parent 5bc74fc296
commit 6bb0d736be
3 changed files with 24 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
using System;
namespace Wox.Infrastructure
{
static class SyntaxSuger<T>
{
public static T RequireNonNull(T obj)
{
if (obj == null)
{
throw new NullReferenceException();
}
else
{
return obj;
}
}
}
}