zijianhuang / webapiclientgen

Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
MIT License
167 stars 38 forks source link

TypeScript CodeDOM refined #145

Closed zijianhuang closed 5 months ago

zijianhuang commented 5 months ago

CodeNamespaceImport, there's no equivalent in TS.

import { Fonlow_PoemsApp_Data_Client, another_namespace } from '../../clientapi/WebApiNG2ClientAuto';

CodePropertySetValueReferenceExpression not supported, however, TS provider does support getter and setter of property.

CodeRegionDirective

CodeRegionMode

CodeCastExpression

CodeMemberMethod.TypeParameters, currently I am using CodeSnipet.

zijianhuang commented 5 months ago
        [Fact]
        public void TestCodeCastExpression()
        {
            TestCodeExpression(new CodeCastExpression("System.Int64", new CodeSnippetExpression("Something") ),
                "(Something as number)");
        }

This is not covering very complex expression that may cause the type casting fail or yield wrong result. Technically I can add make it ((Some complex Expression) as number), however, it may be more flexible that the code gen developer to add the baskets.

zijianhuang commented 5 months ago

done