URSA.Web.Description.OperationInfo.OperationInfo C# (CSharp) Method

OperationInfo() protected method

Initializes a new instance of the OperationInfo class.
protected OperationInfo ( MethodInfo underlyingMethod, Url url, string urlTemplate, Regex templateRegex ) : System
underlyingMethod System.Reflection.MethodInfo Actual underlying method.
url Url Base relative URL of the method without arguments.
urlTemplate string Relative URL template with all arguments included.
templateRegex System.Text.RegularExpressions.Regex Regular expression template with all arguments included.
return System
        protected OperationInfo(MethodInfo underlyingMethod, Url url, string urlTemplate, Regex templateRegex, params ValueInfo[] values) : base(url)
        {
            if (underlyingMethod == null)
            {
                throw new ArgumentNullException("underlyingMethod");
            }

            if (!typeof(IController).IsAssignableFrom(underlyingMethod.DeclaringType))
            {
                throw new ArgumentOutOfRangeException("underlyingMethod");
            }

            if (templateRegex == null)
            {
                throw new ArgumentNullException("templateRegex");
            }

            UnderlyingMethod = underlyingMethod;
            UrlTemplate = urlTemplate;
            TemplateRegex = templateRegex;
            var arguments = new List<ArgumentInfo>();
            var results = new List<ResultInfo>();
            Arguments = arguments;
            Results = results;
            foreach (var value in values ?? new ValueInfo[0])
            {
                value.Method = UnderlyingMethod;
                if (value is ResultInfo)
                {
                    results.Add((ResultInfo)value);
                }
                else
                {
                    arguments.Add((ArgumentInfo)value);
                }
            }
        }
OperationInfo