通过异步方式调用函数时(invokeType为Event),返回结果包含一个RequestId,请问怎样通过这个RequestId获得函数的返回结果
可以考虑将验证FooArgs
转移到FooArgs
类本身。如果这个类是专门为移动参数而设计的,那么它可能是无效的,在这种情况下,可以允许它的构造函数进行验证。
需要添加一个检查,以确保args本身是非空的
if (args == null)
throw new ArgumentNullException(“args”);
if (args.Property1 == null)
throw new ArgumentException(“Property1 cannot be null.”, “args”);
if (args.Property... == null)
throw new ArgumentException(“Property... cannot be null.”, “args”);
if (args.PropertyN == null)
throw new ArgumentException(“Property2 cannot be null.”, “args”);