예제 #1
0
        /// <summary>
        ///     Generates Data Services' method description which is convertable to JSON
        ///     and can be consumed by clients
        /// </summary>
        public static MethodDescription FromMethodInfo(MethodInfoData data, IValueConverter valueConverter)
        {
            MethodDescription methDescription = new MethodDescription(data);

            //else Result is Converted to JSON
            System.Reflection.ParameterInfo[] paramsInfo = data.MethodInfo.GetParameters();
            for (int i = 0; i < paramsInfo.Length; ++i)
            {
                ParamMetadata param = ParamMetadata.FromParamInfo(paramsInfo[i], valueConverter);
                param.ordinal = i;
                methDescription.parameters.Add(param);
            }
            return(methDescription);
        }
예제 #2
0
 public MethodDescription(MethodInfoData data)
 {
     _methodData = data;
     parameters  = new List <ParamMetadata>();
 }