namespace <%= client %>.<%= package %>.BusinessLogic.Extensions
{
using System;
using System.Activities;
///
/// Extensions to the class.
///
public static class InArgumentExtensions
{
///
/// Throws an exception if the value is null.
///
/// The argument.
/// The context.
/// The name of the argument.
/// The argument type.
/// The argument value.
public static T GetRequired(this InArgument inArgument, ActivityContext context, string argumentName)
{
if (context == null)
{
throw new ArgumentNullException(nameof(context));
}
var value = inArgument.Get(context);
if ((value is string && string.IsNullOrEmpty(value as string)) || value == null)
{
throw new ArgumentNullException(argumentName);
}
return value;
}
}
}