Beispiel #1
0
 private string _CreateParamSignature(ParamMetadata paramInfo, DotNet2TS dotNet2TS)
 {
     return(string.Format("{0}{1}: {2}{3};", paramInfo.name, paramInfo.isNullable ? "?" : "",
                          paramInfo.dataType == DataType.None
             ? dotNet2TS.RegisterType(paramInfo.GetParameterType())
             : DotNet2TS.DataTypeToTypeName(paramInfo.dataType),
                          paramInfo.dataType != DataType.None && paramInfo.isArray ? "[]" : ""));
 }
Beispiel #2
0
        public object GetValue(string name, MethodDescription methodDescription, IDataHelper dataHelper)
        {
            MethodParameter par = parameters.Where(p => p.name == name).FirstOrDefault();

            if (par == null)
            {
                return(null);
            }

            ParamMetadata paraminfo = methodDescription.parameters.Where(p => p.name == name).FirstOrDefault();

            if (paraminfo == null)
            {
                throw new DomainServiceException(string.Format("Method: {0} has no parameter with a name: {1}",
                                                               methodDescription.methodName, name));
            }
            return(dataHelper.ParseParameter(paraminfo.GetParameterType(), paraminfo, paraminfo.isArray,
                                             par.value));
        }