コード例 #1
0
ファイル: RunTimeMetadata.cs プロジェクト: BBGONE/JRIApp.Core
        public MethodDescription GetQueryMethod(string dbSetName, string name)
        {
            MethodDescription method = _svcMethods.GetQueryMethod(dbSetName, name);

            if (method == null)
            {
                throw new DomainServiceException(string.Format(ErrorStrings.ERR_QUERY_NAME_INVALID, name));
            }
            return(method);
        }
コード例 #2
0
ファイル: RunTimeMetadata.cs プロジェクト: BBGONE/JRIApp.Core
        public MethodDescription GetInvokeMethod(string name)
        {
            MethodDescription method = _svcMethods.GetInvokeMethod(name);

            if (method == null)
            {
                throw new DomainServiceException(string.Format(ErrorStrings.ERR_METH_NAME_INVALID, name));
            }
            return(method);
        }
コード例 #3
0
        public static MethodsList GetSvcMethods(this IEnumerable <MethodInfoData> allList, IValueConverter valueConverter)
        {
            MethodInfoData[] queryAndInvokes = allList.GetQueryAndInvokeOnly().ToArray();
            MethodsList      methodList      = new MethodsList();

            Array.ForEach(queryAndInvokes, info =>
            {
                MethodDescription methodDescription = MethodDescription.FromMethodInfo(info, valueConverter);
                methodList.Add(methodDescription);
            });

            return(methodList);
        }
コード例 #4
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);
        }