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); }
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); }
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); }
/// <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); }