static void WriteCodeParameterDeclarationExpressionCollection(CodeParameterDeclarationExpressionCollection parameterDeclarations, TextWriter w)
        {
            var pairs = parameterDeclarations.OfType <CodeParameterDeclarationExpression>()
                        .Select(d =>
            {
                var s = $"{d.Name}: {TypeMapper.MapCodeTypeReferenceToTsText(d.Type)}";
                Debug.WriteLine("vvvv " + s);
                return(s);
            });

            w.Write(String.Join(", ", pairs));
        }
Example #2
0
        public static string GetParametersFromExpressions(this CodeParameterDeclarationExpressionCollection codeExpressions, IExpressionFactory expressionFactory, CodeGeneratorOptions options)
        {
            if (codeExpressions.Count <= 0)
            {
                return(string.Empty);
            }

            var parametersFromExpressions = codeExpressions
                                            .OfType <CodeParameterDeclarationExpression>()
                                            .Select(parameter =>
            {
                var parameterExpression = expressionFactory.GetExpression(parameter, options);
                return(parameterExpression.Evaluate());
            })
                                            .ToList();

            return(string.Join(", ", parametersFromExpressions));
        }