├── .editorconfig ├── .github └── workflows │ └── dotnetRelease.yml ├── .gitignore ├── BuildRelease.ps1 ├── CONTRIBUTING.md ├── CreateDebugWebClientApi.ps1 ├── CreateDemoCoreWebClientApi.ps1 ├── CreateDemoGodAssemblyWebClientApi.ps1 ├── CreateDemoTextJsonWebClientApi.ps1 ├── DemoCoreWeb.ClientApi ├── DemoCoreWeb.ClientApi.csproj └── WebApiClientAuto.cs ├── DemoCoreWeb.ClientApiTextJson ├── DemoCoreWeb.ClientApiTextJson.csproj ├── README.md └── WebApiClientTextJsonAuto.cs ├── DemoCoreWeb ├── .config │ └── dotnet-tools.json ├── CodeGen.json ├── CodeGenDebug.json ├── CodeGenSchema.json ├── DemoApps.globalconfig ├── DemoCoreWeb.csproj ├── Program.cs ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── README.md ├── Scripts │ ├── ClientApi │ │ ├── HttpClient.js │ │ ├── HttpClient.ts │ │ ├── WebApiCoreJQClientAuto.js │ │ └── WebApiCoreJQClientAuto.ts │ ├── tests │ │ ├── demo.tests.js │ │ ├── demo.tests.ts │ │ ├── special.tests.js │ │ └── special.tests.ts │ └── typings │ │ ├── jquery │ │ └── jquery.d.ts │ │ └── qunit │ │ └── qunit.d.ts ├── Startup.cs ├── appsettings.Development.json ├── appsettings.json ├── tsconfig.json ├── web.config └── wwwroot │ └── tests.html ├── DemoCoreWebControllers ├── Controllers │ ├── CodeGenController.cs │ ├── DateTypesController.cs │ ├── EntitiesController.cs │ ├── FileUploadController.cs │ ├── HeroesController.cs │ ├── HomeController.cs │ ├── NumbersController.cs │ ├── SpecialTypesController.cs │ ├── StringDataController.cs │ ├── SuperDemoController.cs │ ├── TextDataController.cs │ ├── TupleController.cs │ └── ValuesController.cs ├── DemoCoreWebControllers.csproj └── Helpers │ └── ErrorHandlingMiddleware.cs ├── DemoGodAssemblyWeb ├── CodeGen.json ├── Controllers │ ├── CodeGenController.cs │ ├── DateTypesController.cs │ ├── EntitiesController.cs │ ├── FileUploadController.cs │ ├── HeroesController.cs │ ├── HomeController.cs │ ├── NumbersController.cs │ ├── SpecialTypesController.cs │ ├── StringDataController.cs │ ├── SuperDemoController.cs │ ├── TextDataController.cs │ ├── TupleController.cs │ └── ValuesController.cs ├── DemoGodAssemblyWeb.csproj ├── DemoGodAssemblyWeb.http ├── Helpers │ └── ErrorHandlingMiddleware.cs ├── Models │ ├── AccountBindingModels.cs │ ├── AccountViewModels.cs │ └── Entities.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── README.md ├── appsettings.Development.json └── appsettings.json ├── DemoTextJsonWeb ├── CodeGen.json ├── CodeGenSchema.json ├── DemoTextJsonWeb.csproj ├── DemoTextJsonWeb.http ├── Program.cs ├── Properties │ └── launchSettings.json ├── README.md ├── appsettings.Development.json ├── appsettings.json └── web.config ├── DemoWebApi.DemoDataCore ├── AccountBindingModels.cs ├── AccountViewModels.cs ├── DemoWebApi.DemoDataCore.csproj ├── Entities.cs └── WeatherForecast.cs ├── DemoWebApiDemoDataEx ├── DemoWebApiDemoDataEx.csproj └── ExtendedModels.cs ├── Doc ├── Articles │ ├── ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject.html │ ├── ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files │ │ ├── 6839 │ │ ├── 10278762043895042862 │ │ ├── 15993272203953158972 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── AGSKWxVYyHBdFb43zZd7YyTTxEgjYnjGoUesb9twhPhyHaQewlJUAUw8wF_-whf6NGnFNRPcR8H1rmDNuXdGL3GYLcztB6AkXdBRbWs4jwhFejTcYX9rGDqiXxh-G4v │ │ ├── AGSKWxVbTWv4usV5h3CsRgNYyGC2Mzjt9Bg83Mu6Hu6cZyL0AlsmhEK5D6I22EZL7UrR8v__iSiBeBZAhPfXpkk96r6V998qns1jIT2QgMtS8XSElkoL63xT2AHux81 │ │ ├── AGSKWxX5RZSz4IIubQb0Xvmc64n7CnS_z9xHrM7uXUdPeBtnAjhByhQscoxY-Smpk0V2j0qVz9ZDygY1WRmJBTNNqymkGwmbBP9Rbwft74YD6GDXWq1YrlMqofSD4Re │ │ ├── aframe.html │ │ ├── emptyStarIcon.png │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── l(1) │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject.html │ ├── DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files │ │ ├── 6839 │ │ ├── 10278762043895042862 │ │ ├── 10940427547918388834 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── AGSKWxUWVmxR04xX4819675hbycv9qBCeEdYKfC2CgRw0XfB5d7FN5bpbqA1KF4KwSAHYWiDPU2nHYobOYddRVlc85cyG3uDZ0wINh1O7dOzJHCQpKZoPjdfEQ16IgWOVQ6vj9czPtZf7Q== │ │ ├── AGSKWxUwm6H2ANpCOgdr59ZfWY9IQdECdOUzA7UD3b8FKalj_WoHRqx2ebju8qyU0aHcOktSZJKhgtWv4AUQOLU4Vb2sv_AaDawcbz-GKjiPAFx-7J-SuRvulUI2ctWiCyiRFGy0dXYDyA== │ │ ├── AGSKWxXUAfc82lEJYus9gUlfge-vBmIz0QPLfYDF_o3hSdybgrADpgxJVvBHIsvm43W0VcMyVvXdoyQusfMGBYlq9WrUYXg1AmWpWM2t9gruJ6vy6LXaf6aTP-t9I4lwnq2mLMcUYiy1IQ== │ │ ├── aframe.html │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── Generate C# Client API for ASP.NET Core Web API - CodeProject.html │ ├── Generate C# Client API for ASP.NET Core Web API - CodeProject_files │ │ ├── 6839 │ │ ├── 10278762043895042862 │ │ ├── 10619241673506865619 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── AGSKWxUQl2XlFrJtynmVUl84MQQEhEx2g7j4e-o7DnTtnXsITNQts1kxV_Mbc-_hjzhIu86MxM_XbH0HEStIPjLcL-_-FmHsUjqwJ5adXKaAZiL1GwV24gIgCo-tyPOv2sql0r5JC │ │ ├── AGSKWxWpq-CMWpcIfsMXp4XKS7gEGn0YJY-HCZ0F8kJpJm-b2GjnG7W6cATj-esBPMTvRVG5uvpITZVgjtthvaDgLviWGRWTF5t0P8VglQJEn2oiAZeyZo9-6dhphzne5ARaVm1ok │ │ ├── AGSKWxXsnDPaNTMBmc-kUkot_KGEoT9Fj0pmNypGBsppDREsqYCXcyzOQyiw4XsayzLi_sPob_bq_Ea_apiDp_gMYXWEhHqSMfuq2plEwS83QTyDf8rvBwsoh5NgGpikINtL9Cotw │ │ ├── aframe.html │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── l(1) │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── Generate C# Client API for ASP.NET Web API - CodeProject.html │ ├── Generate C# Client API for ASP.NET Web API - CodeProject_files │ │ ├── 6839 │ │ ├── 12555067034053073112 │ │ ├── 3139474159076857370 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── 869-095b567be01917e3.js.download │ │ ├── AGSKWxUowaokfD6nj4zoH9wWgElQphK6Q1n414_myWSNNUX87AKq4amzNCmCadvpZkPjP94G_CBHN_DIgFtPm2iWK6hAhrknRaMgE94RSmhSNEnqWHWd9w-2A83BGmpOaOaULTl0FGZcgA │ │ ├── AGSKWxVG8HlVhtUWUWd_k-dgAWvB9Ntm7LiKjvBunikiYMBUyFMXmIZJJtN_TlVoAZAerBkRff0iiGFarclMFy4uuAUm2NZSGXseUBHUBN9D34qVgyutQwnC6wdUKxsHQwPipSBYZQDzog │ │ ├── AGSKWxWxI6KAQx8Jp0Nb-uX4sSauQNaU4DV1DhvB5CyaRmSimCB0NKsGN7-nnLRxiL7mtcCmhk2uXWF_7oaDOauoC_OAL93rTomimwLJ0NeUE9XYA1J17niF_r2O-qK5I2lUkzf4jzxi8Q │ │ ├── aframe.html │ │ ├── emptyStarIcon.png │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── layout-12dfdcc6fc1e5fcf.js.download │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── page-ade9d0789736a960.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── Generate TypeScript Client API for ASP.NET Web API- CodeProject.html │ ├── Generate TypeScript Client API for ASP.NET Web API- CodeProject_files │ │ ├── 1.png │ │ ├── Article.min.css │ │ ├── analytics.js.download │ │ ├── article.min.js.download │ │ ├── jquery-3.4.1.min.js.download │ │ ├── js │ │ ├── logo250x135.gif │ │ ├── print48.png │ │ ├── star-empty-lg.png │ │ ├── star-fill-lg.png │ │ ├── t.gif │ │ └── views32.png │ ├── Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject.html │ ├── Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files │ │ ├── 6839 │ │ ├── 3139474159076857370 │ │ ├── 4159795166271768970 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── 869-095b567be01917e3.js.download │ │ ├── AGSKWxUOW2SPxFF9PZajoqkwIH2VVpVj7mvPQ85CfxnCkEEnMP9IB3IU1QQpaRtWkznzptUZXLgyk3My0egtaz-xQBi7LAOL6EXdDhnm8n5d │ │ ├── AGSKWxUdEqHGhlZ-Od-kgVg4ZhmuJaciRpf17--ZV8LLh1vYVNOM9Pp-fud56DHOdaE_IAwVhhFBqW8sihtx2jKl5nC9Bk62nlO5mOvb_DPz │ │ ├── AGSKWxW68qBLOITJOaZDDxHHpqFLvuL-PNk6YZqzbfhtl4bif9ZvwJGXQ6z8uWgTQSRDrs9Qq7t-luVmth2o4N1A1TzJn87vsVnv5MJv66Ez │ │ ├── aframe.html │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── l(1) │ │ ├── layout-12dfdcc6fc1e5fcf.js.download │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── page-ade9d0789736a960.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject.html │ ├── Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files │ │ ├── 6839 │ │ ├── 10940427547918388834 │ │ ├── 3139474159076857370 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── AGSKWxU2g9pd_ALmQ5TgyssrFpmhu_TJ0pgkXR5zr7_00desd-pKtNaopDMyQ98AAW6DI6pvD6D6JZA1QZGwOD3-gq77zc │ │ ├── AGSKWxVa7qz5Os4AlL5kkTvcmfEnN0jgyrUj7UYCIiMIxqm9Zg6S2O8UDowMMWzGFrOetWyzBra8jmzqpeS2Vm7kY9UO3p │ │ ├── AGSKWxVc52zxE1xfmsojrq6RNs2iUxsSJlzvuRx_q6bKZL0WgHnGzBzivCdKzfcL19u91ZhuaxDLCZQPIg7X3tRZh2eGss │ │ ├── aframe.html │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download │ ├── Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject.html │ └── Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files │ │ ├── 6839 │ │ ├── 12987517371217392749 │ │ ├── 4bd1b696-4098621b6d81f3cf.js.download │ │ ├── 6528562391515211296 │ │ ├── 684-7067fe44ff85ebe6.js.download │ │ ├── AGSKWxUp4uGtdDIRfsaoHFdfPn2nVFrSU8iuWA0hKfa8KGAKGZHg81z3fz8KnUkufga_nGT8LA3Y8mBmysW0xucOeyAFE3DwvLo9QgUp8CzWY_gUVjtrIvit3zbK2oT49SfTpRV │ │ ├── AGSKWxW-bu37jL25sQAe_DvfP6b2hYZRhIJZPw4APliYU-nRTLFqBR6SRG-YP9xr9dEDDeM7GkjEmPzNBgYD3sdW1R4hSZf7xh7KVQUymZLq49zB1GOkK2dytJKVPiWHMTMfWbp │ │ ├── AGSKWxXVX0q4Biy0qKSfQ7oMsHSZoCIhFCrOpPMlCMq1WGx4iNX_L5dJ3lZHcJIS0kmaJAjQ8vofFh59URPTDhxScUhnJvtuHF8I-Q7HiwssMCMhGgDovS3cUKMATJCMKi49LMK │ │ ├── aframe.html │ │ ├── f(1).txt │ │ ├── f(2).txt │ │ ├── f(3).txt │ │ ├── f(4).txt │ │ ├── f.txt │ │ ├── f00fbee724adea66.css │ │ ├── js │ │ ├── l │ │ ├── l(1) │ │ ├── logo250x135.gif │ │ ├── main-app-f38f0d9153b95312.js.download │ │ ├── polyfills-42372ed130431b0a.js.download │ │ ├── reach_worklet(1).html │ │ ├── reach_worklet.html │ │ ├── saved_resource(1).html │ │ ├── saved_resource(2).html │ │ ├── saved_resource(3).html │ │ ├── saved_resource(4).html │ │ ├── saved_resource(5).html │ │ ├── saved_resource(6).html │ │ ├── saved_resource.html │ │ ├── sodar │ │ ├── starIcon.png │ │ ├── topics_frame.html │ │ ├── viewsIcon.png │ │ └── webpack-5ed466aeca77ac7a.js.download ├── WebApiClientGen.vpp ├── icons │ ├── TypeScriptCodeDOM.svg │ ├── TypeScriptCodeDOM128.png │ ├── TypeScriptCodeDOM256.png │ └── TypeScriptCodeDOM64.png └── images │ ├── Poco2TsTests.png │ ├── Settings.png │ ├── TS2531Warning.jpg │ ├── WebApiClientGen.Abstract.png │ ├── WebApiClientGen.Poco2Ts.png │ ├── WebApiClientGen.png │ ├── WebApiClientGenCore.png │ ├── WebApiClientGenTests.png │ └── ngTests.png ├── DotNetPack.ps1 ├── Fonlow.Auth.PayloadConverters ├── Fonlow.Auth.PayloadConverters.csproj ├── Models.cs ├── TokenRequestConverter.cs └── TokenResponseConverter.cs ├── Fonlow.DateOnlyExtensions ├── DateOnlyJsonConverter.cs ├── Fonlow.DateOnlyExtensions.csproj └── README.md ├── Fonlow.DateOnlyExtensionsNet ├── DateOnlyJsonConverter.cs ├── DateTimeJsonConverters.cs ├── DateTimeOffsetJsonConverters.cs ├── Fonlow.DateOnlyExtensionsTextJson.csproj └── README.md ├── Fonlow.DocCommentCore ├── DocCommentHelper.cs ├── DocCommentLookup.cs ├── Fonlow.DocCommentCore.csproj ├── README.md ├── StringFunctions.cs ├── XmlDocComment.cs └── XmlDocComment.xsd ├── Fonlow.IntegralExtension ├── BigIntegerJsonConverter.cs ├── Fonlow.IntegralExtensions.csproj ├── Int64JsonConverter.cs ├── README.md └── UInt64JsonConverter.cs ├── Fonlow.IntegralExtensionsTextJson ├── BigIntegerJsonConverter.cs ├── Fonlow.IntegralExtensionsTextJson.csproj ├── Int128JsonConverter.cs ├── Int64JsonConverter.cs ├── README.md ├── UInt128JsonConverter.cs └── UInt64JsonConverter.cs ├── Fonlow.Poco2TsCore ├── AnnotationCommentGenerator.cs ├── AnnotationDeclarationGenerator.cs ├── CherryPicking.cs ├── CherryPickingMethods.cs ├── CodeNamespaceCollectionExtensions.cs ├── CodeNamespaceEx.cs ├── CommentsHelper.cs ├── DotNetTypeCommentGenerator.cs ├── Fonlow.Poco2TsCore.csproj ├── GlobalSuppressions.cs ├── IPoco2Client.cs ├── Poco2TsGen.cs ├── PocoAssemblyFileWalker.cs ├── PocoToTsResponseGen.cs ├── PodGenHelper.cs ├── README.md └── TypeHelper.cs ├── Fonlow.TypeScriptCodeDomCore ├── CodeObjectHelper.cs ├── CodeSnipetTypeReference.cs ├── Consts.cs ├── FieldTypeInfo.cs ├── Fonlow.TypeScriptCodeDomCore.csproj ├── GlobalSuppressions.cs ├── KeywordHandler.cs ├── StringExtensions.cs ├── TsCodeGenerationOptions.cs ├── TsCodeGenerator.cs ├── TsTypeInfo.cs ├── TypeMapper.cs ├── TypeScriptCodeDOM64.png ├── TypeScriptCodeProvider.cs └── _Readme.md ├── HeroesDemo ├── .browserslist ├── .editorconfig ├── .gitignore ├── .vscode │ ├── extensions.json │ ├── launch.json │ └── tasks.json ├── HeroesDemo.esproj_ ├── README.md ├── angular.json ├── buildDev.ps1 ├── buildProd.ps1 ├── e2e │ ├── protractor.conf.js │ ├── src │ │ ├── app.e2e-spec.ts │ │ └── app.po.ts │ └── tsconfig.json ├── jest.config.js ├── karma.conf.js ├── nuget.config ├── package-lock.json ├── package.json ├── runtest.ps1 ├── setup-jest.ts ├── src │ ├── app │ │ ├── app-routing.module.ts │ │ ├── app.component.css │ │ ├── app.component.html │ │ ├── app.component.ts │ │ ├── app.module.ts │ │ ├── dashboard │ │ │ ├── dashboard.component.css │ │ │ ├── dashboard.component.html │ │ │ └── dashboard.component.ts │ │ ├── hero-detail │ │ │ ├── hero-detail.component.html │ │ │ └── hero-detail.component.ts │ │ ├── hero-search │ │ │ ├── hero-search.component.css │ │ │ ├── hero-search.component.html │ │ │ └── hero-search.component.ts │ │ ├── heroes │ │ │ ├── heroes.component.css │ │ │ ├── heroes.component.html │ │ │ └── heroes.component.ts │ │ ├── message.service.ts │ │ ├── messages │ │ │ ├── messages.component.css │ │ │ ├── messages.component.html │ │ │ └── messages.component.ts │ │ └── ngmd.module.ts │ ├── assets │ │ └── themes │ │ │ ├── azure-blue.css │ │ │ ├── cyan-orange.css │ │ │ ├── deeppurple-amber.css │ │ │ ├── indigo-pink.css │ │ │ ├── magenta-violet.css │ │ │ ├── pink-bluegrey.css │ │ │ ├── purple-green.css │ │ │ ├── rose-red.css │ │ │ └── theme.css │ ├── clientapi │ │ ├── WebApiCoreNG2FormGroupClientAuto.ts │ │ ├── WebApiCoreNg2ClientAuto.ts │ │ └── WebApiNG2ClientAuto.spec.ts │ ├── conf │ │ ├── siteconfig.js │ │ └── siteconfigProd.js │ ├── environments │ │ ├── environment.prod.ts │ │ └── environment.ts │ ├── favicon.ico │ ├── index.html │ ├── main.ts │ └── styles.css ├── startDev.ps1 ├── startProd.ps1 ├── tsconfig.app.json ├── tsconfig.json ├── tsconfig.spec.json └── web-test-runner.config.mjs ├── Poco2TsCore ├── Poco2TsCore.csproj ├── Program.cs ├── Properties │ └── launchSettings.json └── README.md ├── README.md ├── SettingsExplained.md ├── SolutionInfo.cs ├── StartDemoCoreWeb.ps1 ├── StartDemoTextJsonWeb.ps1 ├── StartGodAssembly.ps1 ├── TestReleaseAll.ps1 ├── Tests ├── DateOnlyExtensionsTextJsonTests │ ├── AuthModelsConvertersTests.cs │ ├── ConverterFacts.cs │ └── DateOnlyExtensionsTextJsonTests.csproj ├── IntegrationTestShared │ ├── DateTypesIntegration.cs │ ├── DotNetCoreSpecial.cs │ ├── DotNetHostCollection.cs │ ├── EntitiesApiIntegration.cs │ ├── FileUploadIntegration.cs │ ├── HeroesApiIntegration.cs │ ├── IntegrationTestShared.projitems │ ├── IntegrationTestShared.shproj │ ├── NumbersApiIntegration.cs │ ├── StringDataApiIntegration.cs │ ├── StringDataFixture.cs │ ├── SuperDemoIntegration.cs │ ├── TextDataApiIntegrationy.cs │ ├── TextDataFixture.cs │ ├── TupleApiIntegration.cs │ ├── ValuesApiIntegration.cs │ └── ValuesFixture.cs ├── IntegrationTestsCore │ ├── DateTypesFixture.cs │ ├── EntitiesFixture.cs │ ├── HeroesFixture.cs │ ├── IntegrationTestsCore.csproj │ ├── NumbersFixture.cs │ ├── README.md │ ├── SpecialTypesApiIntegration.cs │ ├── SpecialTypesFixture.cs │ ├── SuperDemoFixture.cs │ ├── TupleFixture.cs │ └── appsettings.json ├── IntegrationTestsNF │ ├── App.config │ ├── DateTypesIntegration.cs │ ├── EntitiesApiIntegration.cs │ ├── IntegrationTestsNf.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── ReadMe.MD │ ├── SuperDemoIntegration.cs │ └── packages.config ├── IntegrationTestsTextJson │ ├── BigIntConverter.cs │ ├── DateTypesFixture.cs │ ├── EntitiesFixture.cs │ ├── HeroesFixture.cs │ ├── IntegrationTestsTextJson.csproj │ ├── NumbersFixture.cs │ ├── PolymorphismApiIntegration.cs │ ├── PolymorphismFixture.cs │ ├── README.md │ ├── SpecialTypesApiIntegration.cs │ ├── SpecialTypesFixture.cs │ ├── SuperDemoFixture.cs │ ├── TextJsonNegativeCases.cs │ ├── TupleFixture.cs │ └── appsettings.json ├── Poco2NgFormTests │ ├── GlobalUsings.cs │ ├── Poco2NgFormTests.csproj │ └── TsOutput.cs ├── Poco2TsTestsCore │ ├── DemoCoreWebControllers.xml │ ├── DocCommentTests.cs │ ├── FooTypes.cs │ ├── Misc.cs │ ├── NewtonsoftCherryPickingFacts.cs │ ├── Poco2TsHouseKeeping.cs │ ├── Poco2TsTestsCore.csproj │ ├── StringFunctionsTests.cs │ ├── TestCodeDom.cs │ ├── TextJsonCherryPickingFacts.cs │ ├── TsOutputDataContract.cs │ ├── TsOutputWithAspNet.cs │ ├── TsOutputWithNetCore.cs │ ├── TsOutputWithNewtonSoftJson.cs │ └── TypeHelperTests.cs ├── README.md ├── Tests.globalconfig ├── TypeScriptCodeDomTestsCore │ ├── TsCodeExpression.cs │ ├── TsCodeStatement.cs │ ├── TsICodeGenerator.cs │ ├── TsTypes.cs │ └── TypeScriptCodeDomTestsCore.csproj └── redoc.json ├── UpgradeLog.htm ├── UpgradeLog2.htm ├── WebApiClientGen.sln ├── WebApiClientGen.snk ├── WebApiClientGenCore.Abstract ├── AspNetAttributesHelper.cs ├── ClientApiTsFunctionGenAbstract.cs ├── ClientApiTsFunctionGenBase.cs ├── CodeGenParameters.cs ├── ControllersTsClientApiGenBase.cs ├── GlobalSuppressions.cs ├── MethodHelper.cs ├── Poco2CsGen.cs ├── README.md ├── UriQueryHelper.cs ├── UriTemplateTransform.cs ├── WebApiClientGenCore.Abstract.csproj ├── WebApiDescription.cs └── WebApiDocSingleton.cs ├── WebApiClientGenCore.Aurelia ├── ClientApiTsAureliaFunctionGen.cs ├── ControllersTsAureliaClientApiGen.cs ├── README.md └── WebApiClientGenCore.Aurelia.csproj ├── WebApiClientGenCore.Axios ├── ClientApiTsAxiosFunctionGen.cs ├── ControllersTsAxiosClientApiGen.cs ├── README.md └── WebApiClientGenCore.Axios.csproj ├── WebApiClientGenCore.Fetch ├── ClientApiTsFetchFunctionGen.cs ├── ControllersTsFetchClientApiGen.cs ├── README.md └── WebApiClientGenCore.Fetch.csproj ├── WebApiClientGenCore.NG2 ├── ClientApiTsNg2FunctionGen.cs ├── ControllersTsNG2ClientApiGen.cs ├── README.md └── WebApiClientGenCore.NG2.csproj ├── WebApiClientGenCore.NG2FormGroup ├── CodeObjectHelperForNg2FormGroup.cs ├── ControllersTsNG2FormGroupClientApiGen.cs ├── README.md └── WebApiClientGenCore.NG2FormGroup.csproj ├── WebApiClientGenCore.jQuery ├── ClientApiTsJqFunctionGen.cs ├── ControllersTsJqClientApiGen.cs ├── README.md └── WebApiClientGenCore.jQuery.csproj ├── WebApiClientGenCore ├── ApiExplorerHelper.cs ├── ApiExplorerVisibilityEnabledConvention.cs ├── ClientApiFunctionGen.cs ├── CodeGen.cs ├── CodeGenException.cs ├── ControllersClientApiGen.cs ├── MetaTransform.cs ├── PluginFactory.cs ├── README.md ├── RequiredFromQueryAttribute.cs └── WebApiClientGenCore.csproj ├── _DebugWeb ├── CodeGen.json ├── Controllers │ ├── CodeGenController.cs │ └── DummyController.cs ├── DebugWeb.csproj ├── Entities.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── appsettings.Development.json └── appsettings.json ├── _DebugWebClientApi ├── DebugWebClientApi.csproj └── WebApiClientTextJsonAuto.cs ├── aurelia ├── karma.conf.js ├── package.json ├── readme.txt ├── runtest.ps1 ├── src │ ├── app.spec.ts │ └── clientapi │ │ └── WebApiCoreAureliaClientAuto.ts └── tsconfig.json ├── axios ├── README.md ├── jest.config.js ├── package.json ├── runtest.ps1 ├── src │ ├── All.test.ts │ ├── App.css │ ├── clientapi │ │ └── WebApiCoreAxiosClientAuto.ts │ └── index.css └── tsconfig.json ├── buildJqTests.ps1 ├── fetchapi ├── jest.config.js ├── package.json ├── readme.txt ├── runtest.ps1 ├── src │ ├── app.spec.ts │ └── clientapi │ │ └── WebApiCoreFetchClientAuto.ts └── tsconfig.json ├── global.json ├── license.md └── webapiclientgen.smproj /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # CA1303: Do not pass literals as localized parameters 4 | dotnet_diagnostic.CA1303.severity = none 5 | 6 | # CA1307: Specify StringComparison 7 | dotnet_diagnostic.CA1307.severity = none 8 | 9 | # CA1305: Specify IFormatProvider 10 | dotnet_diagnostic.CA1305.severity = none 11 | 12 | # CA1304: Specify CultureInfo 13 | dotnet_diagnostic.CA1304.severity = none 14 | 15 | # CA1062: Validate arguments of public methods 16 | dotnet_diagnostic.CA1062.severity = none 17 | 18 | # CA1819: Properties should not return arrays 19 | dotnet_diagnostic.CA1819.severity = none 20 | 21 | # CA1055: Uri return values should not be strings 22 | dotnet_diagnostic.CA1055.severity = none 23 | 24 | # CA1054: Uri parameters should not be strings 25 | dotnet_diagnostic.CA1054.severity = none 26 | 27 | # CA1051: Do not declare visible instance fields 28 | dotnet_diagnostic.CA1051.severity = none 29 | 30 | dotnet_diagnostic.CA1711.severity = none 31 | -------------------------------------------------------------------------------- /.github/workflows/dotnetRelease.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a .NET project 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net 3 | 4 | name: .NET Release 5 | 6 | on: 7 | push: 8 | branches: [ "master" ] 9 | pull_request: 10 | branches: [ "master" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | matrix: 18 | node-version: [22.x] 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Setup .NET 23 | uses: actions/setup-dotnet@v4 24 | with: 25 | dotnet-version: 9.0.x 26 | - name: Restore dependencies 27 | run: dotnet restore 28 | - name: Build 29 | run: dotnet build --no-restore --configuration Release 30 | - name: Test 31 | run: dotnet test --no-build --verbosity normal --configuration Release 32 | 33 | 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dll 2 | *.exe 3 | *.pdb 4 | #ignore thumbnails created by windows 5 | Thumbs.db 6 | #Ignore files build by Visual Studio 7 | *.obj 8 | *.user 9 | *.aps 10 | *.pch 11 | *.vspscc 12 | *_i.c 13 | *_p.c 14 | *.ncb 15 | *.suo 16 | *.tlb 17 | *.tlh 18 | *.bak 19 | *.bak* 20 | *.lck 21 | *.vbak 22 | *.cache 23 | *.ilk 24 | *.log 25 | *.map 26 | *.js.map 27 | [Bb]in 28 | [Dd]ebug*/ 29 | *.lib 30 | *.sbr 31 | obj/ 32 | [Rr]elease*/ 33 | _ReSharper*/ 34 | [Tt]est[Rr]esult* 35 | /Fonlow.Oc.WebApi/App_Data 36 | .vs 37 | /DemoAngularJs2/node_modules 38 | /DemoAngular2/node_modules 39 | /DemoWebApi/App_Data/*.ldf 40 | /DemoWebApi/App_Data/*.mdf 41 | /packages 42 | /DemoNGCli/NG 43 | *package-lock.json 44 | /axios/node_modules 45 | /aurelia/coverage 46 | /aurelia/node_modules 47 | /fetchapi/node_modules 48 | /fetchapi/coverage 49 | /DemoNGCli/NGSource/.angular 50 | /DemoNGCli/Prod 51 | /ngdist 52 | /PublishNuGetPackages 53 | -------------------------------------------------------------------------------- /BuildRelease.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | dotnet build webapiclientgen.sln --configuration Release --no-incremental -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | The code gen and other components serve applications developers who would deliver high quality products, thus the quality of the codes generated is critical. Please make sure all test suites pass. 2 | 3 | [Doc](Doc/) contains UML diagrams stored in WebApiClientGen.vpp (Visual Paradigm) which should help you to navigate the source codes. 4 | -------------------------------------------------------------------------------- /CreateDebugWebClientApi.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. 3 | #Step 1: Launch Website 4 | $path = "$PSScriptRoot/DebugWeb" 5 | $procArgs = @{ 6 | FilePath = "dotnet.exe" 7 | ArgumentList = "run $path/DebugWeb.csproj --no-build" 8 | WorkingDirectory = $path 9 | PassThru = $true 10 | } 11 | $process = Start-Process @procArgs 12 | 13 | #Step 2: Run CodeGen 14 | $restArgs = @{ 15 | Uri = 'http://localhost:5000/api/codegen' 16 | Method = 'Post' 17 | InFile = "$PSScriptRoot/DebugWeb/CodeGen.json" 18 | ContentType = 'application/json' 19 | } 20 | try { 21 | $result = Invoke-RestMethod @restArgs 22 | Write-Output $result 23 | } 24 | catch { 25 | Write-Output $_.Exception.Response.StatusCode 26 | $response = $_.Exception.Response.GetResponseStream() 27 | $reader = New-Object System.IO.StreamReader($response) 28 | $reader.BaseStream.Position = 0 29 | $reader.DiscardBufferedData() 30 | $responseBody = $reader.ReadToEnd() 31 | Write-Output $responseBody 32 | } 33 | 34 | Stop-Process $process -------------------------------------------------------------------------------- /CreateDemoGodAssemblyWebClientApi.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. 3 | #Step 1: Launch Website 4 | $path = "$PSScriptRoot/DemoGodAssemblyWeb" 5 | $procArgs = @{ 6 | FilePath = "dotnet.exe" 7 | ArgumentList = "run $path/DemoGodAssemblyWeb.csproj --no-build" 8 | WorkingDirectory = $path 9 | PassThru = $true 10 | } 11 | $process = Start-Process @procArgs 12 | 13 | #Step 2: Run CodeGen 14 | $restArgs = @{ 15 | Uri = 'http://localhost:5000/api/codegen' 16 | Method = 'Post' 17 | InFile = "$path/CodeGen.json" 18 | ContentType = 'application/json' 19 | } 20 | try { 21 | $result = Invoke-RestMethod @restArgs 22 | Write-Output $result 23 | } 24 | catch { 25 | Write-Output $_.Exception.Response.StatusCode 26 | $response = $_.Exception.Response.GetResponseStream() 27 | $reader = New-Object System.IO.StreamReader($response) 28 | $reader.BaseStream.Position = 0 29 | $reader.DiscardBufferedData() 30 | $responseBody = $reader.ReadToEnd() 31 | Write-Output $responseBody 32 | } 33 | 34 | 35 | Stop-Process $process -------------------------------------------------------------------------------- /CreateDemoTextJsonWebClientApi.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | #Make sure CodeGen.json is saved in format ANSI or UTF-8 without BOM, since ASP.NET Core 2.0 Web API will fail to deserialize POST Body that contains BOM. 3 | # Step 3 may be optional 4 | #Step 1: Launch Website 5 | $path = "$PSScriptRoot/DemoTextJsonWeb" 6 | $procArgs = @{ 7 | FilePath = "dotnet.exe" 8 | ArgumentList = "run $path/DemoTextJsonWeb.csproj --no-build --launch-profile CodeGen" 9 | WorkingDirectory = $path 10 | PassThru = $true 11 | } 12 | $process = Start-Process @procArgs 13 | 14 | #Step 2: Run CodeGen 15 | $restArgs = @{ 16 | Uri = 'http://localhost:5000/api/codegen' 17 | Method = 'Post' 18 | InFile = "$path/CodeGen.json" 19 | ContentType = 'application/json' 20 | } 21 | try { 22 | $result = Invoke-RestMethod @restArgs 23 | Write-Output $result 24 | } 25 | catch { 26 | Write-Output $_.Exception.Response.StatusCode 27 | $response = $_.Exception.Response.GetResponseStream() 28 | $reader = New-Object System.IO.StreamReader($response) 29 | $reader.BaseStream.Position = 0 30 | $reader.DiscardBufferedData() 31 | $responseBody = $reader.ReadToEnd() 32 | Write-Output $responseBody 33 | } 34 | 35 | #Step 3: Build the .NET lib to verify 36 | dotnet build ./DemoCoreWeb.ClientApiTextJson/DemoCoreWeb.ClientApiTextJson.csproj 37 | 38 | Stop-Process $process -------------------------------------------------------------------------------- /DemoCoreWeb.ClientApi/DemoCoreWeb.ClientApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 2.0.0 6 | True 7 | latest-all 8 | 9 | 10 | 11 | 1701;1702;1570;1591;1573;IDE0090;IDE0044 12 | 13 | 14 | 15 | 1701;1702;1570;1591;1573;IDE0090;IDE0044 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /DemoCoreWeb.ClientApiTextJson/DemoCoreWeb.ClientApiTextJson.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | latest-all 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /DemoCoreWeb.ClientApiTextJson/README.md: -------------------------------------------------------------------------------- 1 | Generated client API codes utilizing System.Text.Json. 2 | 3 | Integration test suits is Tests/IntegrationTestsTextJson. 4 | 5 | The codegen.json of the Web API should be: 6 | 1. `"UseSystemTextJson": true` 7 | 1. `"ClientLibraryProjectFolderName": "..\\..\\..\\..\\DemoCoreWeb.ClientApiTextJson"` 8 | -------------------------------------------------------------------------------- /DemoCoreWeb/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "6.0.2", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /DemoCoreWeb/CodeGenDebug.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSelections": { 3 | "ExcludedControllerNames": [ 4 | "DemoWebApi.Controllers.Home", 5 | "DemoWebApi.Controllers.FileUpload" 6 | ], 7 | 8 | "DataModels": [ 9 | { 10 | "AssemblyName": "DemoWebApi.DemoDataCore", 11 | "CherryPickingMethods": 3 12 | }, 13 | 14 | { 15 | "AssemblyName": "DemoCoreWeb", 16 | "CherryPickingMethods": 3 17 | } 18 | ], 19 | 20 | "CherryPickingMethods": 3 21 | }, 22 | 23 | "ClientApiOutputs": { 24 | "ClientLibraryProjectFolderName": "..\\..\\DemoCoreWeb.ClientApi", 25 | "GenerateBothAsyncAndSync": true, 26 | "DIFriendly": true, 27 | "StringAsString": true, 28 | "CamelCase": true, 29 | "CSClientNamespaceSuffix": ".Client", 30 | "UseEnsureSuccessStatusCodeEx": true, 31 | 32 | "Plugins": [ 33 | { 34 | "AssemblyName": "Fonlow.WebApiClientGenCore.NG2", 35 | "TargetDir": "..\\..\\DemoNGCli\\NGSource\\src\\ClientApi", 36 | "TSFile": "WebApiCoreNG2ClientAuto.ts", 37 | "AsModule": true, 38 | "ContentType": "application/json;charset=UTF-8", 39 | "ClientNamespaceSuffix": ".Client", 40 | "ContainerNameSuffix": "" 41 | } 42 | ] 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /DemoCoreWeb/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 |  2 | 5 | 6 | 7 | True 8 | False 9 | True 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net6.0\publish\ 14 | FileSystem 15 | 16 | net6.0 17 | ff2c1a74-2993-4b88-8995-809bb997ad7a 18 | false 19 | win-x64 20 | 21 | -------------------------------------------------------------------------------- /DemoCoreWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "IIS Express": { 4 | "commandName": "IISExpress", 5 | "launchBrowser": true, 6 | "launchUrl": "api/values", 7 | "environmentVariables": { 8 | "ASPNETCORE_ENVIRONMENT": "Development" 9 | } 10 | }, 11 | "DemoCoreWeb": { 12 | "commandName": "Project", 13 | "workingDirectory": "bin\\Debug\\net9.0", 14 | "launchBrowser": true, 15 | "launchUrl": "api/values", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "applicationUrl": "http://localhost:56321/" 20 | } 21 | }, 22 | "iisSettings": { 23 | "windowsAuthentication": false, 24 | "anonymousAuthentication": true, 25 | "iisExpress": { 26 | "applicationUrl": "http://localhost:56321/", 27 | "sslPort": 0 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /DemoCoreWeb/README.md: -------------------------------------------------------------------------------- 1 | # DemoCoreWeb 2 | 3 | Utilizing Newtonsoft.Json, this Web service contains rich data types and Web API prototypes for covering maximum number of data types in .NET and Web API prototypes in ASP.NET. 4 | 5 | # Testing Client API for jQuery 6 | 7 | This CS project contains TS codes for testing client API for jQuery, and the test platform is QUnit. And the JS test suites is hosted in the same Web service. 8 | 9 | The TS files in Scripts are compiled into `./wwwroot/scripts/` according to `tsconfig.json` when saving, then run "UpdateJqTests.bat" to copy to `bin/Debug/Net8.0/wwwroot'. 10 | 11 | After launching DemoCoreWeb, run `tests.html`. 12 | 13 | **Reamrks** 14 | 15 | * Sometimes the launched Web service insists on using cached JS files somewhere, then build DemoCoreWeb and launch again. 16 | 17 | 18 | **Hints** 19 | 20 | * When using the DEBUG build hosting in IIS, you need to modify `DemoCoreWeb.staticwebassets.runtime.json` and change CurrentRoots to: 21 | `"ContentRoots":["C:\\inetpub\\wwwroot\\DemoCoreWebService\\wwwroot\\"]` or alike, absolute path needed. 22 | -------------------------------------------------------------------------------- /DemoCoreWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /DemoCoreWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "Debug": { 5 | "LogLevel": { 6 | "Default": "Warning" 7 | } 8 | }, 9 | "Console": { 10 | "LogLevel": { 11 | "Default": "Information" 12 | } 13 | } 14 | }, 15 | 16 | "Kestrel": { 17 | "EndPoints": { 18 | "Http": { 19 | "Url": "http://localhost:5000" 20 | }, 21 | 22 | "HttpsDefaultCert": { 23 | "Url": "https://localhost:5001" 24 | } 25 | 26 | } 27 | 28 | } 29 | 30 | 31 | } 32 | -------------------------------------------------------------------------------- /DemoCoreWeb/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": true, 3 | "compilerOptions": { 4 | "outDir": "./wwwroot/scripts/", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "ES2022", 11 | "lib": [ 12 | "ES2022", 13 | "dom" 14 | ] 15 | 16 | }, 17 | 18 | "exclude": [ 19 | "scripts/typing/qunit/qunit-1.16.d.ts" 20 | ] 21 | } -------------------------------------------------------------------------------- /DemoCoreWeb/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DemoCoreWeb/wwwroot/tests.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | QUnit Example 6 | 7 | 8 | 9 |
10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Test with DemoCore Web 19 | -------------------------------------------------------------------------------- /DemoCoreWebControllers/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace DemoWebApi.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | public class HomeController : Controller 11 | { 12 | [HttpGet] 13 | public ActionResult Index() 14 | { 15 | ViewBag.Title = "Home Page"; 16 | 17 | return View(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DemoCoreWebControllers/DemoCoreWebControllers.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | True 7 | latest-minimum 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Web; 5 | using Microsoft.AspNetCore.Mvc; 6 | 7 | namespace DemoWebApi.Controllers 8 | { 9 | [Route("api/[controller]")] 10 | public class HomeController : Controller 11 | { 12 | [HttpGet] 13 | public ActionResult Index() 14 | { 15 | ViewBag.Title = "Home Page"; 16 | 17 | return View(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/DemoGodAssemblyWeb.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | True 7 | latest-minimum 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/DemoGodAssemblyWeb.http: -------------------------------------------------------------------------------- 1 | @DemoGodAssemblyWeb_HostAddress = http://localhost:5193 2 | 3 | GET {{DemoGodAssemblyWeb_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:27348", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": false, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "http://localhost:5000", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DemoGodAssemblyWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/DemoTextJsonWeb.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | latest-minimum 7 | True 8 | 2.1 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/DemoTextJsonWeb.http: -------------------------------------------------------------------------------- 1 | @DemoTextJsonWeb_HostAddress = http://localhost:5017 2 | 3 | GET {{DemoTextJsonWeb_HostAddress}}/weatherforecast/ 4 | Accept: application/json 5 | 6 | ### 7 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:51940", 8 | "sslPort": 44318 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": false, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "http://localhost:6000", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "https": { 23 | "commandName": "Project", 24 | "dotnetRunMessages": true, 25 | "launchBrowser": true, 26 | "launchUrl": "swagger", 27 | "applicationUrl": "https://localhost:6001", 28 | "environmentVariables": { 29 | "ASPNETCORE_ENVIRONMENT": "Development" 30 | } 31 | }, 32 | "CodeGen": { 33 | "commandName": "Project", 34 | "dotnetRunMessages": true, 35 | "launchBrowser": false, 36 | "launchUrl": "swagger", 37 | "applicationUrl": "http://localhost:5000", 38 | "environmentVariables": { 39 | "ASPNETCORE_ENVIRONMENT": "Development" 40 | } 41 | }, 42 | 43 | "IIS Express": { 44 | "commandName": "IISExpress", 45 | "launchBrowser": true, 46 | "launchUrl": "swagger", 47 | "environmentVariables": { 48 | "ASPNETCORE_ENVIRONMENT": "Development" 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/README.md: -------------------------------------------------------------------------------- 1 | # DemoTextJsonWeb 2 | 3 | Almost identical to DemoCoreWeb, this Web API utializes System.Text.Json for serialization, and not hosting jQuery scripts. 4 | 5 | The integration test suite is primarily Tests/IntegrationTestsTextJson, while IntegrationTestsCore can also be used from time to time. -------------------------------------------------------------------------------- /DemoTextJsonWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | }, 7 | "IncludeScopes": false, 8 | "Debug": { 9 | "LogLevel": { 10 | "Default": "Warning" 11 | } 12 | }, 13 | "Console": { 14 | "LogLevel": { 15 | "Default": "Information" 16 | } 17 | } 18 | }, 19 | 20 | "AllowedHosts": "*" 21 | 22 | } 23 | -------------------------------------------------------------------------------- /DemoTextJsonWeb/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DemoWebApi.DemoDataCore/DemoWebApi.DemoDataCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | true 6 | latest-minimum 7 | 8 | 9 | 10 | 1701;1702;1705;1591 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /DemoWebApi.DemoDataCore/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebApplication1 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateOnly Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string? Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /DemoWebApiDemoDataEx/DemoWebApiDemoDataEx.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DemoWebApiDemoDataEx/ExtendedModels.cs: -------------------------------------------------------------------------------- 1 | using DemoWebApi.DemoData; 2 | using System.Runtime.Serialization; 3 | 4 | namespace DemoWebApi.DemoDataEx 5 | { 6 | [DataContract] 7 | public class Trust : BizEntity 8 | { 9 | [DataMember] 10 | public string Trustee { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/10278762043895042862: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/10278762043895042862 -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/15993272203953158972: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/15993272203953158972 -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/emptyStarIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/emptyStarIcon.png -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/l(1): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/l(1) -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/ASP.NET Web API, Angular2, TypeScript and WebApiClientGen - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/10278762043895042862: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/10278762043895042862 -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/10940427547918388834: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/10940427547918388834 -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/DateOnly in .NET 6 and ASP.NET Core 6 - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/10278762043895042862: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/10278762043895042862 -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/10619241673506865619: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/10619241673506865619 -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l(1): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/l(1) -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Core Web API - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/12555067034053073112: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/12555067034053073112 -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/3139474159076857370: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/3139474159076857370 -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/emptyStarIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/emptyStarIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate C# Client API for ASP.NET Web API - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/1.png -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/print48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/print48.png -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/star-empty-lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/star-empty-lg.png -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/star-fill-lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/star-fill-lg.png -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/t.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/t.gif -------------------------------------------------------------------------------- /Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/views32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate TypeScript Client API for ASP.NET Web API- CodeProject_files/views32.png -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/3139474159076857370: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/3139474159076857370 -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/4159795166271768970: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/4159795166271768970 -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/l(1): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/l(1) -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Generate Typed FormGroup of Angular Reactive Forms with ASP.NET Core Web API - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/10940427547918388834: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/10940427547918388834 -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/3139474159076857370: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/3139474159076857370 -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Intended Solutions for Intentional Limitations of Strongly Typed OpenAPI Client Generators - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/12987517371217392749: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/12987517371217392749 -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/6528562391515211296: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/6528562391515211296 -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/aframe.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/l: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/l -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/l(1): -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/l(1) -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/logo250x135.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/logo250x135.gif -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/main-app-f38f0d9153b95312.js.download: -------------------------------------------------------------------------------- 1 | (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[358],{836:(e,s,n)=>{Promise.resolve().then(n.t.bind(n,894,23)),Promise.resolve().then(n.t.bind(n,4970,23)),Promise.resolve().then(n.t.bind(n,6614,23)),Promise.resolve().then(n.t.bind(n,6975,23)),Promise.resolve().then(n.t.bind(n,7555,23)),Promise.resolve().then(n.t.bind(n,4911,23)),Promise.resolve().then(n.t.bind(n,9665,23)),Promise.resolve().then(n.t.bind(n,1295,23))},9393:()=>{}},e=>{var s=s=>e(e.s=s);e.O(0,[441,684],()=>(s(5415),s(836))),_N_E=e.O()}]); -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/reach_worklet(1).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/reach_worklet.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/saved_resource(2).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/saved_resource(3).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/saved_resource(4).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/saved_resource(5).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/saved_resource(6).html: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/sodar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/sodar -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/starIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/starIcon.png -------------------------------------------------------------------------------- /Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/viewsIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/Articles/Tour of Heroes_ Blazor WebAssembly Standalone App - CodeProject_files/viewsIcon.png -------------------------------------------------------------------------------- /Doc/WebApiClientGen.vpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/WebApiClientGen.vpp -------------------------------------------------------------------------------- /Doc/icons/TypeScriptCodeDOM128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/icons/TypeScriptCodeDOM128.png -------------------------------------------------------------------------------- /Doc/icons/TypeScriptCodeDOM256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/icons/TypeScriptCodeDOM256.png -------------------------------------------------------------------------------- /Doc/icons/TypeScriptCodeDOM64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/icons/TypeScriptCodeDOM64.png -------------------------------------------------------------------------------- /Doc/images/Poco2TsTests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/Poco2TsTests.png -------------------------------------------------------------------------------- /Doc/images/Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/Settings.png -------------------------------------------------------------------------------- /Doc/images/TS2531Warning.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/TS2531Warning.jpg -------------------------------------------------------------------------------- /Doc/images/WebApiClientGen.Abstract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/WebApiClientGen.Abstract.png -------------------------------------------------------------------------------- /Doc/images/WebApiClientGen.Poco2Ts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/WebApiClientGen.Poco2Ts.png -------------------------------------------------------------------------------- /Doc/images/WebApiClientGen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/WebApiClientGen.png -------------------------------------------------------------------------------- /Doc/images/WebApiClientGenCore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/WebApiClientGenCore.png -------------------------------------------------------------------------------- /Doc/images/WebApiClientGenTests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/WebApiClientGenTests.png -------------------------------------------------------------------------------- /Doc/images/ngTests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Doc/images/ngTests.png -------------------------------------------------------------------------------- /DotNetPack.ps1: -------------------------------------------------------------------------------- 1 | # pack existing release build 2 | Set-Location $PSScriptRoot 3 | $packCmd = 'dotnet pack $Name --no-build --output Release --configuration Release' 4 | $projList = 'Fonlow.Poco2TsCore/Fonlow.Poco2TsCore.csproj', 'Fonlow.DocCommentCore/Fonlow.DocCommentCore.csproj', 'Fonlow.Web.MetaCore/Fonlow.Web.MetaCore.csproj', 'WebApiClientGenCore.Abstract/WebApiClientGenCore.Abstract.csproj', 'WebApiClientGenCore/WebApiClientGenCore.csproj', 'WebApiClientGenCore.NG2/WebApiClientGenCore.NG2.csproj', 'WebApiClientGenCore.NG2FormGroup/WebApiClientGenCore.NG2FormGroup.csproj', 'WebApiClientGenCore.Aurelia/WebApiClientGenCore.Aurelia.csproj', 'WebApiClientGenCore.Axios/WebApiClientGenCore.Axios.csproj', 'WebApiClientGenCore.Fetch/WebApiClientGenCore.Fetch.csproj', 'WebApiClientGenCore.jQuery/WebApiClientGenCore.jQuery.csproj', 'Fonlow.DateOnlyExtensions/Fonlow.DateOnlyExtensions.csproj', 'Fonlow.DateOnlyExtensionsNet/Fonlow.DateOnlyExtensionsTextJson.csproj', 'Fonlow.IntegralExtension/Fonlow.IntegralExtensions.csproj', 'Fonlow.IntegralExtensionsTextJson/Fonlow.IntegralExtensionsTextJson.csproj' 5 | foreach($name in $projList){ 6 | Invoke-Expression $ExecutionContext.InvokeCommand.ExpandString($packCmd) 7 | } -------------------------------------------------------------------------------- /Fonlow.Auth.PayloadConverters/Fonlow.Auth.PayloadConverters.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Fonlow.DateOnlyExtensions/README.md: -------------------------------------------------------------------------------- 1 | **!For ASP.NET Core 6 only!** 2 | 3 | Customized serialization for DateOnly in ASP.NET Core 6 and above, introduced in .NET 6, for the following clients: 4 | 5 | 1. .NET 6 clients 6 | 1. .NET Framework clients 7 | 1. JavaScript clients 8 | 9 | This component depends on NewtonSoft.Json and derives from Newtonsoft.Json.JsonConverter, and can be injected to ASP.NET Core pipeline through only `IServiceCollection.AddNewtonsoftJson()`. 10 | 11 | **Usages:** 12 | ```c# 13 | .AddNewtonsoftJson( 14 | options => 15 | { 16 | options.SerializerSettings.DateParseHandling = Newtonsoft.Json.DateParseHandling.DateTimeOffset; //Better with this for cross-timezone minValue and .NET Framework clients. 17 | options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore; //So when controller will ignore null fileds when returing data 18 | 19 | options.SerializerSettings.Converters.Add(new DateOnlyJsonConverter()); //not needed for ASP.NET 7 and .NET 7 clients. However .NET 6 clients and .NET Framework clients still need DateOnlyJsonConverter 20 | options.SerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); // also, needed by JavaScript clients. 21 | } 22 | ); 23 | 24 | ``` 25 | 26 | **Remarks:** 27 | 28 | * .NET 7 clients and above do not need this in ASP.NET Core 7 and above. 29 | 30 | **Hints:** 31 | * [DateOnly in .NET 6 and ASP.NET Core 6](https://www.codeproject.com/Articles/5325820/DateOnly-in-NET-6-and-ASP-NET-Core-6) 32 | * [DateOnly in ASP.NET 7 with JavaScript Clients](https://www.codeproject.com/Tips/5347111/DateOnly-in-ASP-NET-7-with-JavaScript-Clients) -------------------------------------------------------------------------------- /Fonlow.DocCommentCore/DocCommentHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | 6 | namespace Fonlow.DocComment 7 | { 8 | /// 9 | /// Helper functions of accessing doc comments of a method 10 | /// 11 | public static class DocCommentHelper 12 | { 13 | static readonly string newLine=Environment.NewLine; 14 | 15 | public static string GetSummary(docMember m) 16 | { 17 | if (m == null || m.summary == null || m.summary.Text == null || m.summary.Text.Length == 0) 18 | { 19 | return null; 20 | } 21 | 22 | IList noIndent = StringFunctions.TrimTrimIndentsOfArray(m.summary.Text); 23 | return String.Join(newLine, noIndent); 24 | } 25 | 26 | public static string GetReturnComment(docMember m) 27 | { 28 | if (m == null || m.returns == null || m.returns.Text == null || m.returns.Text.Length == 0) 29 | { 30 | return null; 31 | } 32 | 33 | IList noIndent = StringFunctions.TrimTrimIndentsOfArray(m.returns.Text); 34 | return String.Join(newLine, noIndent); 35 | } 36 | 37 | public static string GetParameterComment(docMember m, string name) 38 | { 39 | if (m == null || m.param == null) 40 | { 41 | return null; 42 | } 43 | 44 | docMemberParam mc = m.param.SingleOrDefault(d => d.name == name); 45 | if (mc == null || mc.Text == null || mc.Text.Length == 0) 46 | { 47 | return null; 48 | } 49 | 50 | IList noIndent = StringFunctions.TrimTrimIndentsOfArray(mc.Text); 51 | return String.Join(newLine, noIndent); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Fonlow.DocCommentCore/README.md: -------------------------------------------------------------------------------- 1 | Basic functions of accessing XML Doc Comments. 2 | 3 | **Remarks:** 4 | * The parser of XML is generated with XmlDocument.xsd. -------------------------------------------------------------------------------- /Fonlow.IntegralExtensionsTextJson/BigIntegerJsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Numerics; 3 | using System.Text.Json.Serialization; 4 | using System.Text.Json; 5 | 6 | namespace Fonlow.IntegralExtensions 7 | { 8 | public class BigIntegerJsonConverter : JsonConverter 9 | { 10 | public override BigInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 11 | { 12 | if (reader.TokenType == JsonTokenType.Number) 13 | { 14 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 15 | string rawText = doc.RootElement.GetRawText(); 16 | return BigInteger.Parse(rawText, NumberFormatInfo.InvariantInfo); 17 | } 18 | else if (reader.TokenType == JsonTokenType.String) 19 | { 20 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 21 | string text = doc.RootElement.GetString(); 22 | return BigInteger.Parse(text, NumberFormatInfo.InvariantInfo); 23 | } 24 | 25 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 26 | } 27 | 28 | public override void Write(Utf8JsonWriter writer, BigInteger value, JsonSerializerOptions options) => 29 | writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Fonlow.IntegralExtensionsTextJson/Int128JsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text.Json; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace Fonlow.IntegralExtensions 6 | { 7 | public class Int128JsonConverter : JsonConverter 8 | { 9 | public override Int128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 10 | { 11 | if (reader.TokenType == JsonTokenType.Number) 12 | { 13 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 14 | string rawText = doc.RootElement.GetRawText(); 15 | return Int128.Parse(rawText, NumberFormatInfo.InvariantInfo); 16 | } 17 | else if (reader.TokenType == JsonTokenType.String) 18 | { 19 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 20 | string text = doc.RootElement.GetString(); 21 | return Int128.Parse(text, NumberFormatInfo.InvariantInfo); 22 | } 23 | 24 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 25 | } 26 | 27 | public override void Write(Utf8JsonWriter writer, Int128 value, JsonSerializerOptions options) => 28 | writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Fonlow.IntegralExtensionsTextJson/Int64JsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text.Json; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace Fonlow.IntegralExtensions 6 | { 7 | public class Int64JsonConverter : JsonConverter 8 | { 9 | public override Int64 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 10 | { 11 | if (reader.TokenType == JsonTokenType.Number) 12 | { 13 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 14 | string rawText = doc.RootElement.GetRawText(); 15 | return Int64.Parse(rawText, NumberFormatInfo.InvariantInfo); 16 | } 17 | else if (reader.TokenType == JsonTokenType.String) 18 | { 19 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 20 | string text = doc.RootElement.GetString(); 21 | return Int64.Parse(text, NumberFormatInfo.InvariantInfo); 22 | } 23 | 24 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 25 | } 26 | 27 | public override void Write(Utf8JsonWriter writer, Int64 value, JsonSerializerOptions options) => 28 | writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Fonlow.IntegralExtensionsTextJson/UInt128JsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text.Json; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace Fonlow.IntegralExtensions 6 | { 7 | public class UInt128JsonConverter : JsonConverter 8 | { 9 | public override UInt128 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 10 | { 11 | if (reader.TokenType == JsonTokenType.Number) 12 | { 13 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 14 | string rawText = doc.RootElement.GetRawText(); 15 | return UInt128.Parse(rawText, NumberFormatInfo.InvariantInfo); 16 | } 17 | else if (reader.TokenType == JsonTokenType.String) 18 | { 19 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 20 | string text = doc.RootElement.GetString(); 21 | return UInt128.Parse(text, NumberFormatInfo.InvariantInfo); 22 | } 23 | 24 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 25 | } 26 | 27 | public override void Write(Utf8JsonWriter writer, UInt128 value, JsonSerializerOptions options) => 28 | writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Fonlow.IntegralExtensionsTextJson/UInt64JsonConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Text.Json; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace Fonlow.IntegralExtensions 6 | { 7 | public class UInt64JsonConverter : JsonConverter 8 | { 9 | public override UInt64 Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 10 | { 11 | if (reader.TokenType == JsonTokenType.Number) 12 | { 13 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 14 | string rawText = doc.RootElement.GetRawText(); 15 | return UInt64.Parse(rawText, NumberFormatInfo.InvariantInfo); 16 | } 17 | else if (reader.TokenType == JsonTokenType.String) 18 | { 19 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 20 | string text = doc.RootElement.GetString(); 21 | return UInt64.Parse(text, NumberFormatInfo.InvariantInfo); 22 | } 23 | 24 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 25 | } 26 | 27 | public override void Write(Utf8JsonWriter writer, UInt64 value, JsonSerializerOptions options) => 28 | writer.WriteStringValue(value.ToString(NumberFormatInfo.InvariantInfo)); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Fonlow.Poco2TsCore/CodeNamespaceEx.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.CodeDom; 3 | using System.Collections.Generic; 4 | using System.Diagnostics.CodeAnalysis; 5 | 6 | namespace Fonlow.CodeDom 7 | { 8 | public class CodeNamespaceEx : CodeNamespace 9 | { 10 | public bool DataModelOnly { get; private set; } 11 | 12 | public CodeNamespaceEx(string name, bool dataModelOnly): base(name) 13 | { 14 | DataModelOnly= dataModelOnly; 15 | } 16 | } 17 | 18 | public class CodeNamespaceComparer : IEqualityComparer 19 | { 20 | public bool Equals(CodeNamespaceEx x, CodeNamespaceEx y) 21 | { 22 | return x.Name==y.Name && x.DataModelOnly==y.DataModelOnly; 23 | } 24 | 25 | public int GetHashCode([DisallowNull] CodeNamespaceEx obj) 26 | { 27 | if (Object.ReferenceEquals(obj, null)) return 0; 28 | 29 | int hashProductName = obj.Name == null ? 0 : obj.Name.GetHashCode(); 30 | 31 | //Get hash code for the Code field. 32 | int hashProductCode = obj.DataModelOnly.GetHashCode(); 33 | 34 | //Calculate the hash code for the product. 35 | return hashProductName ^ hashProductCode; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Fonlow.Poco2TsCore/CommentsHelper.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel.DataAnnotations; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Fonlow.Poco2Client 9 | { 10 | public static class CommentsHelper 11 | { 12 | /// 13 | /// Generate doc comments from attributes, and the attributes are sorted according to RequiredAttribute 14 | /// 15 | /// 16 | /// 17 | /// 18 | public static string[] GenerateCommentsFromAttributes( 19 | #pragma warning disable CA1002 // Do not expose generic lists, but I need to sort it. 20 | List attributes, 21 | #pragma warning restore CA1002 // Do not expose generic lists 22 | IDictionary> attribueCommentDic) 23 | { 24 | List ss = new List(); 25 | attributes.Sort((x, y) => 26 | { 27 | // Special-case RequiredAttribute so that it shows up on top 28 | if (x is RequiredAttribute) 29 | { 30 | return -1; 31 | } 32 | if (y is RequiredAttribute) 33 | { 34 | return 1; 35 | } 36 | 37 | return 0; 38 | }); 39 | 40 | foreach (Attribute attribute in attributes) 41 | { 42 | if (attribueCommentDic.TryGetValue(attribute.GetType(), out Func textGenerator)) 43 | { 44 | ss.Add(textGenerator(attribute)); 45 | } 46 | } 47 | 48 | return ss.ToArray(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Fonlow.Poco2TsCore/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Fonlow.Poco2TsCore/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Fonlow.Poco2TsCore/IPoco2Client.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.CodeDom; 3 | using System.IO; 4 | using System.Reflection; 5 | 6 | namespace Fonlow.Poco2Client 7 | { 8 | public interface IPoco2Client 9 | { 10 | void CreateCodeDom(Type[] types, CherryPickingMethods methods); 11 | void CreateCodeDomInAssembly(Assembly assembly, CherryPickingMethods methods, Fonlow.DocComment.DocCommentLookup docLookup, bool dataAnnotationsToComments); 12 | void SaveCodeToFile(string fileName); 13 | CodeTypeReference TranslateToClientTypeReference(Type type); 14 | 15 | /// 16 | /// Initialize a CodeDOM provider which write CodeDOM to TextWriter 17 | /// 18 | /// 19 | void WriteCode(TextWriter writer); 20 | 21 | /// 22 | /// For god assembly 23 | /// 24 | /// 25 | /// 26 | /// 27 | CodeTypeDeclaration CheckOrAdd(Type type, bool dcOnly); 28 | 29 | } 30 | } -------------------------------------------------------------------------------- /Fonlow.Poco2TsCore/README.md: -------------------------------------------------------------------------------- 1 | Generate data model interfaces in TypsScript from POCO classes. This has been used in POCO2TS.exe and "Strongly Typed Web API Client API Generators". 2 | 3 | Please check: 4 | 5 | * https://github.com/zijianhuang/webapiclientgen/wiki/POCO2TS.exe 6 | * https://www.codeproject.com/Articles/1247700/Generate-TypeScript-Interfaces-from-POCO-Classes 7 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/CodeSnipetTypeReference.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.TypeScriptCodeDom 2 | { 3 | /// 4 | /// Support code snipet as BaseType. 5 | /// CodeTypeReference seems to have a bug which could not read such callbackType properly with 5 or more Tuple parameters. 6 | /// I had tried to provide callbackTypeText in constructors of CodeTypeReference and CodeParrameterDeclarationExpression, as well as property assignment. 7 | /// all end up with "(string ", corrupted. 8 | /// So this class is a hack against the possible bug of CodeTypeReference in dealing with Tuple 9 | /// 10 | /// 11 | /// CodeTypeReference will fail at these 2 forms of Tuple 12 | /// callback: (data : {Item1:string, Item2:string, Item3:string, Item4:string, Item5:number} 13 | /// callback: (data : [string, string, string, string, number]) 14 | /// 15 | public sealed class CodeSnipetTypeReference : System.CodeDom.CodeTypeReference 16 | { 17 | public CodeSnipetTypeReference(string typeName) 18 | { 19 | BaseType = typeName; 20 | } 21 | 22 | /// 23 | /// Hide the BaseType of CodeTypeReference 24 | /// 25 | /// The new keyword could not entirely hide the ancestor's BaseType, but at least stop the BaseType assignment from being refined by CodeTypeRefernce's built-in parser. 26 | public new string BaseType { get; private set; } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/Consts.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.TypeScriptCodeDom 2 | { 3 | /// 4 | /// Keys used in the UserData property of some CodeDOM declarations, while the values store type info. 5 | /// 6 | public class UserDataKeys 7 | { 8 | public const string CustomAttributes = "CustomAttributes"; 9 | public const string FieldTypeInfo = "FieldTypeInfo"; 10 | public const string ParameterDescriptor = "ParameterDescriptor"; 11 | public const string TsTypeInfo = "TsTypeInfo"; 12 | public const string IsMethodParameter = "IsMethodParameter"; 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/FieldTypeInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.TypeScriptCodeDom 2 | { 3 | /// 4 | /// Used in UserData for passing type info of a field to a code generator. 5 | /// 6 | public class FieldTypeInfo 7 | { 8 | public bool IsComplex { get; set; } 9 | public bool IsArray { get; set; } 10 | public string TypeFullName { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/GlobalSuppressions.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Fonlow.TypeScriptCodeDomCore/GlobalSuppressions.cs -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/StringExtensions.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.Text 2 | { 3 | public static class StringExtensions 4 | { 5 | /// 6 | /// Convert string to camel case. 7 | /// 8 | /// 9 | /// 10 | public static string ToCamelCase(this string s) 11 | { 12 | if (string.IsNullOrWhiteSpace(s) || !char.IsUpper(s[0])) 13 | { 14 | return s; 15 | } 16 | 17 | char[] chars = s.ToCharArray(); 18 | 19 | for (int i = 0; i < chars.Length; i++) 20 | { 21 | if (i == 1 && !char.IsUpper(chars[i])) 22 | { 23 | break; 24 | } 25 | 26 | bool hasNext = (i + 1 < chars.Length); 27 | if (i > 0 && hasNext && !char.IsUpper(chars[i + 1])) 28 | { 29 | break; 30 | } 31 | 32 | char c; 33 | c = char.ToLower(chars[i], System.Globalization.CultureInfo.InvariantCulture); 34 | chars[i] = c; 35 | } 36 | 37 | return new string(chars); 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/TsCodeGenerationOptions.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.TypeScriptCodeDom 2 | { 3 | /// 4 | /// Singleton of CodeGeneratorOptions, with property CamelCase 5 | /// 6 | public class TsCodeGenerationOptions : System.CodeDom.Compiler.CodeGeneratorOptions 7 | { 8 | public bool CamelCase { get; set; } 9 | 10 | #region Singleton 11 | TsCodeGenerationOptions() 12 | { 13 | } 14 | 15 | public static TsCodeGenerationOptions Instance { get { return Nested.instance; } } 16 | 17 | private static class Nested 18 | { 19 | static Nested() 20 | { 21 | } 22 | 23 | internal static readonly TsCodeGenerationOptions instance = new TsCodeGenerationOptions(); 24 | } 25 | #endregion 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/TsTypeInfo.cs: -------------------------------------------------------------------------------- 1 | namespace Fonlow.TypeScriptCodeDom 2 | { 3 | /// 4 | /// Used in UserData to deliver type info to a code generator. 5 | /// 6 | public class TsTypeInfo 7 | { 8 | public TypeOfType TypeOfType { get; set; } 9 | } 10 | 11 | /// 12 | /// To give signal to a code generator which could decide adjustments for outputs. 13 | /// 14 | public enum TypeOfType { IsInterface, IsClass, IsEnum } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Fonlow.TypeScriptCodeDomCore/TypeScriptCodeDOM64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/Fonlow.TypeScriptCodeDomCore/TypeScriptCodeDOM64.png -------------------------------------------------------------------------------- /HeroesDemo/.browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # For the full list of supported browsers by the Angular framework, please see: 6 | # https://angular.io/guide/browser-support 7 | 8 | # You can see what browsers were selected by your queries by running: 9 | # npx browserslist 10 | 11 | last 3 Chrome version 12 | last 3 Firefox version 13 | last 2 Edge major versions 14 | last 2 Safari major versions 15 | last 2 iOS major versions 16 | Firefox ESR 17 | -------------------------------------------------------------------------------- /HeroesDemo/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see https://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 4 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.ts] 12 | quote_type = single 13 | 14 | [*.md] 15 | max_line_length = off 16 | trim_trailing_whitespace = false 17 | -------------------------------------------------------------------------------- /HeroesDemo/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # Compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | /bazel-out 8 | 9 | # Node 10 | /node_modules 11 | npm-debug.log 12 | yarn-error.log 13 | 14 | # IDEs and editors 15 | .idea/ 16 | .project 17 | .classpath 18 | .c9/ 19 | *.launch 20 | .settings/ 21 | *.sublime-workspace 22 | 23 | # Visual Studio Code 24 | .vscode/* 25 | !.vscode/settings.json 26 | !.vscode/tasks.json 27 | !.vscode/launch.json 28 | !.vscode/extensions.json 29 | .history/* 30 | 31 | # Miscellaneous 32 | /.angular/cache 33 | .sass-cache/ 34 | /connect.lock 35 | /coverage 36 | /libpeerconnection.log 37 | testem.log 38 | /typings 39 | 40 | # System files 41 | .DS_Store 42 | Thumbs.db 43 | -------------------------------------------------------------------------------- /HeroesDemo/.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 3 | "recommendations": ["angular.ng-template"] 4 | } 5 | -------------------------------------------------------------------------------- /HeroesDemo/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "edge", 6 | "request": "launch", 7 | "name": "localhost (Edge)", 8 | "url": "http://localhost:4200", 9 | "webRoot": "${workspaceFolder}" 10 | }, 11 | { 12 | "type": "chrome", 13 | "request": "launch", 14 | "name": "localhost (Chrome)", 15 | "url": "http://localhost:4200", 16 | "webRoot": "${workspaceFolder}" 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /HeroesDemo/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 3 | "version": "2.0.0", 4 | "tasks": [ 5 | { 6 | "type": "npm", 7 | "script": "start", 8 | "isBackground": true, 9 | "problemMatcher": { 10 | "owner": "typescript", 11 | "pattern": "$tsc", 12 | "background": { 13 | "activeOnStart": true, 14 | "beginsPattern": { 15 | "regexp": "(.*?)" 16 | }, 17 | "endsPattern": { 18 | "regexp": "bundle generation complete" 19 | } 20 | } 21 | } 22 | }, 23 | { 24 | "type": "npm", 25 | "script": "test", 26 | "isBackground": true, 27 | "problemMatcher": { 28 | "owner": "typescript", 29 | "pattern": "$tsc", 30 | "background": { 31 | "activeOnStart": true, 32 | "beginsPattern": { 33 | "regexp": "(.*?)" 34 | }, 35 | "endsPattern": { 36 | "regexp": "bundle generation complete" 37 | } 38 | } 39 | } 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /HeroesDemo/HeroesDemo.esproj_: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | npm run build 8 | 9 | $(MSBuildProjectDirectory)\dist\DateOnlyNG 10 | 11 | -------------------------------------------------------------------------------- /HeroesDemo/buildDev.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | ng build --configuration=dev -------------------------------------------------------------------------------- /HeroesDemo/buildProd.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | ng build --configuration=production -------------------------------------------------------------------------------- /HeroesDemo/e2e/protractor.conf.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Protractor configuration file, see link for more information 3 | // https://github.com/angular/protractor/blob/master/lib/config.ts 4 | 5 | const { SpecReporter, StacktraceOption } = require('jasmine-spec-reporter'); 6 | 7 | /** 8 | * @type { import("protractor").Config } 9 | */ 10 | exports.config = { 11 | allScriptsTimeout: 11000, 12 | specs: [ 13 | './src/**/*.e2e-spec.ts' 14 | ], 15 | capabilities: { 16 | browserName: 'chrome' 17 | }, 18 | directConnect: true, 19 | SELENIUM_PROMISE_MANAGER: false, 20 | baseUrl: 'http://localhost:4200/', 21 | framework: 'jasmine', 22 | jasmineNodeOpts: { 23 | showColors: true, 24 | defaultTimeoutInterval: 30000, 25 | print: function() {} 26 | }, 27 | onPrepare() { 28 | require('ts-node').register({ 29 | project: require('path').join(__dirname, './tsconfig.json') 30 | }); 31 | jasmine.getEnv().addReporter(new SpecReporter({ 32 | spec: { 33 | displayStacktrace: StacktraceOption.PRETTY 34 | } 35 | })); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /HeroesDemo/e2e/src/app.po.ts: -------------------------------------------------------------------------------- 1 | import { browser, by, element } from 'protractor'; 2 | 3 | export class AppPage { 4 | async navigateTo(): Promise { 5 | return browser.get(browser.baseUrl); 6 | } 7 | 8 | async getTitleText(): Promise { 9 | return element(by.css('app-root h1')).getText(); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /HeroesDemo/e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "../tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "../out-tsc/e2e", 6 | "module": "commonjs", 7 | "target": "es2018", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /HeroesDemo/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'jest-preset-angular', 3 | setupFilesAfterEnv: ['/setup-jest.ts'], 4 | globalSetup: 'jest-preset-angular/global-setup', 5 | }; -------------------------------------------------------------------------------- /HeroesDemo/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /HeroesDemo/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular.io-example", 3 | "version": "0.0.0", 4 | "description": "Example project from an angular.io guide.", 5 | "license": "MIT", 6 | "scripts": { 7 | "ng": "ng", 8 | "start": "ng serve", 9 | "build": "ng build", 10 | "watch": "ng build --watch --configuration development", 11 | "test": "ng test", 12 | "e2e": "ng e2e" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@angular/animations": "20.0.0", 17 | "@angular/cdk": "20.0.1", 18 | "@angular/common": "20.0.0", 19 | "@angular/compiler": "20.0.0", 20 | "@angular/core": "20.0.0", 21 | "@angular/forms": "20.0.0", 22 | "@angular/material": "20.0.1", 23 | "@angular/material-moment-adapter": "20.0.1", 24 | "@angular/platform-browser": "20.0.0", 25 | "@angular/platform-browser-dynamic": "20.0.0", 26 | "@angular/router": "20.0.0", 27 | "rxjs": "7.8.1", 28 | "tslib": "2.7.0", 29 | "zone.js": "0.15.0" 30 | }, 31 | "devDependencies": { 32 | "@angular-devkit/build-angular": "20.0.0", 33 | "@angular/cli": "20.0.0", 34 | "@angular/compiler-cli": "20.0.0", 35 | "@types/jasmine": "5.1.8", 36 | "@types/node": "22.15.18", 37 | "copyfiles": "2.4.1", 38 | "jasmine-core": "5.7.1", 39 | "jasmine-marbles": "0.9.2", 40 | "jasmine-spec-reporter": "~7.0.0", 41 | "karma": "6.4.4", 42 | "karma-chrome-launcher": "3.2.0", 43 | "karma-coverage": "2.2.1", 44 | "karma-jasmine": "~5.1.0", 45 | "karma-jasmine-html-reporter": "2.1.0", 46 | "protractor": "~7.0.0", 47 | "ts-node": "10.9.2", 48 | "typescript": "^5.8.3" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /HeroesDemo/runtest.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | ng test -------------------------------------------------------------------------------- /HeroesDemo/setup-jest.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular/setup-jest'; -------------------------------------------------------------------------------- /HeroesDemo/src/app/app-routing.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { RouterModule, Routes } from '@angular/router'; 3 | 4 | import { DashboardComponent } from './dashboard/dashboard.component'; 5 | import { HeroesComponent } from './heroes/heroes.component'; 6 | import { HeroDetailComponent } from './hero-detail/hero-detail.component'; 7 | 8 | const routes: Routes = [ 9 | { path: '', redirectTo: '/dashboard', pathMatch: 'full' }, 10 | { path: 'dashboard', component: DashboardComponent }, 11 | { path: 'detail/:id', component: HeroDetailComponent }, 12 | { path: 'heroes', component: HeroesComponent } 13 | ]; 14 | 15 | @NgModule({ 16 | imports: [ RouterModule.forRoot(routes) ], 17 | exports: [ RouterModule ] 18 | }) 19 | export class AppRoutingModule {} 20 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | /* AppComponent's private CSS styles */ 2 | h1 { 3 | margin-bottom: 0; 4 | } 5 | nav a { 6 | padding: 1rem; 7 | text-decoration: none; 8 | margin-top: 10px; 9 | display: inline-block; 10 | background-color: #e8e8e8; 11 | color: #3d3d3d; 12 | border-radius: 4px; 13 | } 14 | nav a:hover { 15 | color: white; 16 | background-color: #42545C; 17 | } 18 | nav a.active { 19 | background-color: black; 20 | } 21 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |

{{title}}

2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-root', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'], 7 | standalone: false 8 | }) 9 | export class AppComponent { 10 | title = 'Tour of Heroes'; 11 | } 12 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/dashboard/dashboard.component.css: -------------------------------------------------------------------------------- 1 | /* DashboardComponent's private CSS styles */ 2 | 3 | h2 { 4 | text-align: center; 5 | } 6 | 7 | .heroes-menu { 8 | padding: 0; 9 | margin: auto; 10 | max-width: 1000px; 11 | 12 | /* flexbox */ 13 | display: -webkit-box; 14 | display: -moz-box; 15 | display: -ms-flexbox; 16 | display: -webkit-flex; 17 | display: flex; 18 | flex-direction: row; 19 | flex-wrap: wrap; 20 | justify-content: space-around; 21 | align-content: flex-start; 22 | align-items: flex-start; 23 | } 24 | 25 | a { 26 | background-color: #3f525c; 27 | border-radius: 2px; 28 | padding: 1rem; 29 | font-size: 1.2rem; 30 | text-decoration: none; 31 | display: inline-block; 32 | color: #fff; 33 | text-align: center; 34 | width: 100%; 35 | min-width: 70px; 36 | margin: .5rem auto; 37 | box-sizing: border-box; 38 | 39 | /* flexbox */ 40 | order: 0; 41 | flex: 0 1 auto; 42 | align-self: auto; 43 | } 44 | 45 | @media (min-width: 600px) { 46 | a { 47 | width: 18%; 48 | box-sizing: content-box; 49 | } 50 | } 51 | 52 | a:hover { 53 | background-color: black; 54 | } 55 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/dashboard/dashboard.component.html: -------------------------------------------------------------------------------- 1 |

Top Heroes

2 |
3 | @for (hero of heroes; track hero) { 4 | 6 | {{hero.name}} 7 | 8 | } 9 |
10 | 11 | 12 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/dashboard/dashboard.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, Inject, OnInit } from '@angular/core'; 2 | import * as namespaces from '../../clientapi/WebApiCoreNG2FormGroupClientAuto'; 3 | 4 | @Component({ 5 | selector: 'app-dashboard', 6 | templateUrl: './dashboard.component.html', 7 | styleUrls: ['./dashboard.component.css'], 8 | standalone: false 9 | }) 10 | export class DashboardComponent implements OnInit { 11 | heroes: namespaces.DemoWebApi_Controllers_Client.Hero[] = []; 12 | 13 | constructor(private heroService: namespaces.DemoWebApi_Controllers_Client.Heroes) { } 14 | 15 | ngOnInit(): void { 16 | this.heroService.getHeroes().subscribe( 17 | { 18 | next: heroes => { 19 | this.heroes = heroes.slice(1, 5); 20 | }, 21 | error: error => console.error(error) 22 | } 23 | ); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/hero-search/hero-search.component.css: -------------------------------------------------------------------------------- 1 | /* HeroSearch private styles */ 2 | 3 | label { 4 | display: block; 5 | font-weight: bold; 6 | font-size: 1.2rem; 7 | margin-top: 1rem; 8 | margin-bottom: .5rem; 9 | 10 | } 11 | input { 12 | padding: .5rem; 13 | width: 100%; 14 | max-width: 600px; 15 | box-sizing: border-box; 16 | display: block; 17 | } 18 | 19 | input:focus { 20 | outline: #336699 auto 1px; 21 | } 22 | 23 | li { 24 | list-style-type: none; 25 | } 26 | .search-result li a { 27 | border-bottom: 1px solid gray; 28 | border-left: 1px solid gray; 29 | border-right: 1px solid gray; 30 | display: inline-block; 31 | width: 100%; 32 | max-width: 600px; 33 | padding: .5rem; 34 | box-sizing: border-box; 35 | text-decoration: none; 36 | color: black; 37 | } 38 | 39 | .search-result li a:hover { 40 | background-color: #435A60; 41 | color: white; 42 | } 43 | 44 | ul.search-result { 45 | margin-top: 0; 46 | padding-left: 0; 47 | } 48 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/hero-search/hero-search.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 14 |
15 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/heroes/heroes.component.html: -------------------------------------------------------------------------------- 1 |

My Heroes

2 | 3 |
4 | 5 | 6 | 7 | 8 | 11 |
12 | 13 | 24 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/message.service.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | 3 | @Injectable({ providedIn: 'root' }) 4 | export class MessageService { 5 | messages: string[] = []; 6 | 7 | add(message: string) { 8 | this.messages.push(message); 9 | } 10 | 11 | clear() { 12 | this.messages = []; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/messages/messages.component.css: -------------------------------------------------------------------------------- 1 | /* MessagesComponent's private CSS styles */ 2 | h2 { 3 | color: #A80000; 4 | font-family: Arial, Helvetica, sans-serif; 5 | font-weight: lighter; 6 | } 7 | 8 | .clear { 9 | color: #333; 10 | background-color: #eee; 11 | margin-bottom: 12px; 12 | padding: 1rem; 13 | border-radius: 4px; 14 | font-size: 1rem; 15 | } 16 | .clear:hover { 17 | color: #fff; 18 | background-color: #42545C; 19 | } 20 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/messages/messages.component.html: -------------------------------------------------------------------------------- 1 | @if (messageService.messages.length) { 2 |
3 |

Messages

4 | 7 | @for (message of messageService.messages; track message) { 8 |
{{message}}
9 | } 10 |
11 | } 12 | -------------------------------------------------------------------------------- /HeroesDemo/src/app/messages/messages.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | import { MessageService } from '../message.service'; 3 | 4 | @Component({ 5 | selector: 'app-messages', 6 | templateUrl: './messages.component.html', 7 | styleUrls: ['./messages.component.css'], 8 | standalone: false 9 | }) 10 | export class MessagesComponent implements OnInit { 11 | 12 | constructor(public messageService: MessageService) {} 13 | 14 | ngOnInit() { 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /HeroesDemo/src/conf/siteconfig.js: -------------------------------------------------------------------------------- 1 | const SITE_CONFIG = { 2 | apiBaseuri: "http://localhost:5000/" 3 | } 4 | -------------------------------------------------------------------------------- /HeroesDemo/src/conf/siteconfigProd.js: -------------------------------------------------------------------------------- 1 | const SITE_CONFIG = { 2 | apiBaseuri: "https://heroes.fonlow.net/webapi/" 3 | } 4 | -------------------------------------------------------------------------------- /HeroesDemo/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | declare const SITE_CONFIG: { 2 | apiBaseuri?: string; 3 | } 4 | 5 | interface SiteConfigConstantsType { 6 | apiBaseuri?: string; 7 | } 8 | 9 | export const environment = { 10 | production: true 11 | }; 12 | 13 | export const SiteConfigConstants: SiteConfigConstantsType = { 14 | 15 | ...(typeof SITE_CONFIG === 'undefined' ? {} : SITE_CONFIG), 16 | } 17 | -------------------------------------------------------------------------------- /HeroesDemo/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | declare const SITE_CONFIG: { 6 | apiBaseuri?: string; 7 | } 8 | 9 | interface SiteConfigConstantsType { 10 | apiBaseuri?: string; 11 | } 12 | 13 | export const environment = { 14 | production: false 15 | }; 16 | 17 | export const SiteConfigConstants: SiteConfigConstantsType = { 18 | 19 | ...(typeof SITE_CONFIG === 'undefined' ? {} : SITE_CONFIG), 20 | } 21 | -------------------------------------------------------------------------------- /HeroesDemo/src/favicon.ico: -------------------------------------------------------------------------------- 1 | �PNG 2 |  3 | IHDR?�~� pHYs  ��~�fIDATH��WKLQ���̔�uG�� e�n�. 6qcb�l?���D`�F#� Ku�F 1Qc� 4 | ��!���� ��C�P�|B?$���ܱ3����I&}��}�̽s�[*�ɀU�A��K��yx�gY�Ajq��3L Š���˫�OD�4��3Ϗ:X�3��o�P J�ğo#IH�a����,{>1/�2$�R AR]�)w��?�sZw^��q�Y�m_��e���r[8�^� 5 | �&p��-���A}c��- ������!����2_) E�)㊪j���v�m��ZOi� g�nW�{�n.|�e2�a&�0aŸ����be�̀��C�fˤE%-{�ֺ��׮C��N��jXi�~c�C,t��T�����r�{� �L)s��V��6%�(�#ᤙ!�]��H�ҐH$R���^R�A�61(?Y舚�>���(Z����Qm�L2�K�ZIc�� 6 | ���̧�C��2!⅄�(����"�Go��>�q��=��$%�z`ѯ��T�&����PHh�Z!=���z��O��������,*VVV�1�f*CJ�]EE��K�k��d�#5���`2yT!�}7���߈~�,���zs�����y�T��V������D��C2�G��@%̑72Y�޾{oJ�"@��^h�~ ��fĬ�!a�D��6���Ha|�3��� [>�����]7U2п���]�ė 7 | ��PU� �.Wejq�in�g��+p<ߺQH����總j[������.��� Q���p _�K�� 1(��+��bB8�\ra 8 | �́�v.l���(���ǽ�w���L��w�8�C��IEND�B`� -------------------------------------------------------------------------------- /HeroesDemo/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tour of Heroes 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /HeroesDemo/src/main.ts: -------------------------------------------------------------------------------- 1 | import { enableProdMode } from '@angular/core'; 2 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 3 | 4 | import { AppModule } from './app/app.module'; 5 | import { environment } from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule) 12 | .catch(err => console.error(err)); 13 | -------------------------------------------------------------------------------- /HeroesDemo/src/styles.css: -------------------------------------------------------------------------------- 1 | /* Global Styles */ 2 | * { 3 | font-family: Arial, Helvetica, sans-serif; 4 | } 5 | h1 { 6 | color: #264D73; 7 | font-size: 2.5rem; 8 | } 9 | h2, h3 { 10 | color: #444; 11 | font-weight: lighter; 12 | } 13 | h3 { 14 | font-size: 1.3rem; 15 | } 16 | body { 17 | padding: .5rem; 18 | max-width: 1000px; 19 | margin: auto; 20 | } 21 | @media (min-width: 600px) { 22 | body { 23 | padding: 2rem; 24 | } 25 | } 26 | body, input[text] { 27 | color: #333; 28 | font-family: Cambria, Georgia, serif; 29 | } 30 | a { 31 | cursor: pointer; 32 | } 33 | 34 | /* Navigation link styles */ 35 | nav a { 36 | padding: 5px 10px; 37 | text-decoration: none; 38 | margin-right: 10px; 39 | margin-top: 10px; 40 | display: inline-block; 41 | background-color: #e8e8e8; 42 | color: #3d3d3d; 43 | border-radius: 4px; 44 | } 45 | 46 | nav a:hover { 47 | color: white; 48 | background-color: #42545C; 49 | } 50 | nav a.active { 51 | background-color: black; 52 | color: white; 53 | } 54 | hr { 55 | margin: 1.5rem 0; 56 | } 57 | -------------------------------------------------------------------------------- /HeroesDemo/startDev.ps1: -------------------------------------------------------------------------------- 1 | #Run prod build with dotnet hosting 2 | Set-Location $PSScriptRoot 3 | dotnet-serve -d ../ngdist/dev/browser -p 5200 4 | -------------------------------------------------------------------------------- /HeroesDemo/startProd.ps1: -------------------------------------------------------------------------------- 1 | #Run prod build with dotnet hosting 2 | Set-Location $PSScriptRoot 3 | dotnet-serve -d ../ngdist/prod -p 5200 4 | -------------------------------------------------------------------------------- /HeroesDemo/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts", 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ], 14 | "exclude": [ 15 | "src/test.ts", 16 | "src/**/*.spec.ts", 17 | "src/**/*-specs.ts", 18 | "src/**/*.avoid.ts", 19 | "src/**/*.0.ts", 20 | "src/**/*.1.ts", 21 | "src/**/*.1b.ts", 22 | "src/**/*.2.ts", 23 | "src/**/*.3.ts", 24 | "src/**/*.4.ts", 25 | "src/**/*.5.ts", 26 | "src/**/*.6.ts", 27 | "src/**/*.7.ts", 28 | "src/**/testing" 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /HeroesDemo/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "esModuleInterop": true, 9 | "strict": true, 10 | "noImplicitOverride": true, 11 | "noPropertyAccessFromIndexSignature": true, 12 | "noImplicitReturns": true, 13 | "noFallthroughCasesInSwitch": true, 14 | "sourceMap": true, 15 | "declaration": false, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "bundler", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "lib": [ 22 | "ES2022", 23 | "dom" 24 | ] 25 | }, 26 | "angularCompilerOptions": { 27 | "enableI18nLegacyMessageIdFormat": false, 28 | "strictInjectionParameters": true, 29 | "strictInputAccessModifiers": true, 30 | "strictTemplates": true 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /HeroesDemo/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "files": [ 11 | ], 12 | "include": [ 13 | "src/**/*.spec.ts", 14 | "src/**/*.d.ts" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /HeroesDemo/web-test-runner.config.mjs: -------------------------------------------------------------------------------- 1 | import { esbuildPlugin } from '@web/dev-server-esbuild'; 2 | 3 | export default { 4 | concurrency: 10, 5 | nodeResolve: true, 6 | watch: true, 7 | rootDir: '../', 8 | 9 | files: ['src/**/*.spec.ts'], 10 | plugins: [esbuildPlugin({ ts: true })], 11 | } 12 | -------------------------------------------------------------------------------- /Poco2TsCore/Poco2TsCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | net9.0 6 | true 7 | 1.7 8 | Build for .NET 9 9 | en 10 | MIT 11 | https://github.com/zijianhuang/webapiclientgen 12 | Zijian Huang 13 | latest-all 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Poco2TsCore/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "WSL": { 4 | "commandName": "WSL2", 5 | "distributionName": "" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /Poco2TsCore/README.md: -------------------------------------------------------------------------------- 1 | This is a shell console app calling FonlowPoco2TsCore to convert POCO classes to TypeScript interfaces and enum types, along with doc comments stored in XML of the assembly. 2 | 3 | **Prerequisites:** 4 | 5 | * .NET 7 or 8 6 | 7 | Please check: 8 | 9 | * https://github.com/zijianhuang/webapiclientgen/wiki/POCO2TS.exe 10 | * https://www.codeproject.com/Articles/1247700/Generate-TypeScript-Interfaces-from-POCO-Classes 11 | -------------------------------------------------------------------------------- /SolutionInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | 3 | [assembly: AssemblyCompany("Fonlow")] 4 | [assembly: AssemblyCopyright("Copyright © Fonlow 2015-2020")] 5 | [assembly: AssemblyTrademark("")] 6 | [assembly: AssemblyCulture("")] 7 | -------------------------------------------------------------------------------- /StartDemoCoreWeb.ps1: -------------------------------------------------------------------------------- 1 | #Launch WebApi Website and POST a request for generating client APIs 2 | Set-Location $PSScriptRoot 3 | $path = "$PSScriptRoot/DemoCoreWeb/bin/Debug/net9.0" 4 | $procArgs = @{ 5 | FilePath = "dotnet.exe" 6 | ArgumentList = "$path/DemoCoreWeb.dll" 7 | WorkingDirectory = $path 8 | PassThru = $true 9 | } 10 | $process = Start-Process @procArgs 11 | 12 | Invoke-RestMethod http://localhost:5000/api/values -Method GET 13 | 14 | -------------------------------------------------------------------------------- /StartDemoTextJsonWeb.ps1: -------------------------------------------------------------------------------- 1 | #Launch WebApi Website and POST a request for generating client APIs 2 | Set-Location $PSScriptRoot 3 | $path = "$PSScriptRoot/DemoTextJsonWeb" 4 | $procArgs = @{ 5 | FilePath = "dotnet.exe" 6 | ArgumentList = "run --project $path/DemoTextJsonWeb.csproj --no-build --launch-profile CodeGen" 7 | WorkingDirectory = $path 8 | PassThru = $true 9 | } 10 | $process = Start-Process @procArgs 11 | 12 | Invoke-RestMethod http://localhost:5000/api/values -Method GET 13 | 14 | -------------------------------------------------------------------------------- /StartGodAssembly.ps1: -------------------------------------------------------------------------------- 1 | #Launch WebApi Website and POST a request for generating client APIs 2 | Set-Location $PSScriptRoot 3 | $path = "$PSScriptRoot/DemoGodAssemblyWeb" 4 | $procArgs = @{ 5 | FilePath = "dotnet.exe" 6 | ArgumentList = "run $path/DemoGodAssemblyWeb.csproj --no-build" 7 | WorkingDirectory = $path 8 | PassThru = $true 9 | } 10 | $process = Start-Process @procArgs 11 | 12 | Invoke-RestMethod http://localhost:5000/api/values -Method GET 13 | 14 | -------------------------------------------------------------------------------- /TestReleaseAll.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | dotnet test --verbosity normal --configuration Release --no-build -------------------------------------------------------------------------------- /Tests/DateOnlyExtensionsTextJsonTests/DateOnlyExtensionsTextJsonTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | false 7 | true 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | all 19 | runtime; build; native; contentfiles; analyzers; buildtransitive 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Tests/IntegrationTestShared/DotNetHostCollection.cs: -------------------------------------------------------------------------------- 1 | using Xunit; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class TestConstants 6 | { 7 | public const string LaunchWebApiAndInit = "LaunchWebApi"; 8 | } 9 | 10 | [CollectionDefinition(TestConstants.LaunchWebApiAndInit)] 11 | public class DotNetHostCollection : ICollectionFixture 12 | { 13 | // This class has no code, and is never created. Its purpose is simply 14 | // to be the place to apply [CollectionDefinition] and all the 15 | // ICollectionFixture<> interfaces. 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Tests/IntegrationTestShared/IntegrationTestShared.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 60b7393d-9285-4d0a-a368-877ed60c6c11 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Tests/IntegrationTestShared/StringDataFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class StringDataFixture : BasicHttpClient 6 | { 7 | public StringDataFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoWebApi.Controllers.Client.StringData(HttpClient); 12 | } 13 | 14 | public DemoWebApi.Controllers.Client.StringData Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestShared/TextDataFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class TextDataFixture : BasicHttpClient 6 | { 7 | public TextDataFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoWebApi.Controllers.Client.TextData(HttpClient); 12 | } 13 | 14 | public DemoWebApi.Controllers.Client.TextData Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestShared/ValuesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class ValuesFixture : BasicHttpClient 6 | { 7 | public ValuesFixture() 8 | { 9 | //httpClient.DefaultRequestHeaders 10 | // .Accept 11 | // .Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json"));//.net core has different behavior as described at https://github.com/zijianhuang/webapiclientgen/issues/26 12 | 13 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 14 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 15 | Api = new DemoWebApi.Controllers.Client.Values(HttpClient); 16 | } 17 | 18 | public DemoWebApi.Controllers.Client.Values Api { get; private set; } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/DateTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class DateTypesFixture : BasicHttpClient 6 | { 7 | public DateTypesFixture() 8 | { 9 | Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() 10 | { 11 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 12 | }; 13 | 14 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); no need to use these converters since .NET 7 15 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 16 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 17 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 18 | Api = new DemoWebApi.Controllers.Client.DateTypes(HttpClient, jsonSerializerSettings); 19 | } 20 | 21 | public DemoWebApi.Controllers.Client.DateTypes Api { get; private set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/EntitiesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | using Fonlow.DateOnlyExtensions; 3 | 4 | namespace IntegrationTests 5 | { 6 | /* 7 | And make sure the testApi credential exists through 8 | POST to http://localhost:10965/api/Account/Register 9 | Content-Type: application/json 10 | 11 | { 12 | Email: 'testapi@test.com', 13 | Password: 'Tttttttt_8', 14 | ConfirmPassword: 'Tttttttt_8' 15 | } 16 | 17 | */ 18 | public class EntitiesFixture : BasicHttpClient 19 | { 20 | public EntitiesFixture() 21 | { 22 | Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() 23 | { 24 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 25 | }; 26 | 27 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); //not needed in ASP.NET 7 28 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 29 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 30 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 31 | Api = new DemoWebApi.Controllers.Client.Entities(HttpClient, jsonSerializerSettings); 32 | } 33 | 34 | public DemoWebApi.Controllers.Client.Entities Api { get; private set; } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/HeroesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class HeroesFixture : BasicHttpClient 6 | { 7 | public HeroesFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoWebApi.Controllers.Client.Heroes(HttpClient); 12 | } 13 | 14 | public DemoWebApi.Controllers.Client.Heroes Api { get; private set; } 15 | } 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/NumbersFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class NumbersFixture : BasicHttpClient 6 | { 7 | public NumbersFixture() 8 | { 9 | Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() 10 | { 11 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 12 | }; 13 | 14 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 15 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 16 | Api = new DemoWebApi.Controllers.Client.Numbers(HttpClient, jsonSerializerSettings); 17 | } 18 | 19 | public DemoWebApi.Controllers.Client.Numbers Api { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/README.md: -------------------------------------------------------------------------------- 1 | For testing the runtime behavior of .NET Core Client API codes utilizing Newtonsoft.Json on both sides. 2 | 3 | The primary test endpoint is DemoCoreWeb. And DemoTextJsonWeb that uses System.Text.Json should be used as well from time to time. 4 | 5 | **Hints:** 6 | 7 | * When testing with DemoTextJsonWeb, just launch DemoTextJsonWeb first, then the auto launch of DemoCoreWeb will fail, and the test suite will actually talk to DemoTextJsonWeb. 8 | 9 | 10 | **Remarks:** 11 | 12 | * As of .NET 3, 5, 6, 7 and 8, System.Text.Json has been approaching total replacement of Newtonsoft.Json, covering more and more CLR strongly typed data models. 13 | * However, as of .NET 8, when this test suite talks to DemoTextJsonWeb, there are still around 6 test cases failed revealing that what System.Text.Json is not yet capable of, when talking to DemoTextJsonWeb. Please read the doc documents of failed cases for details. 14 | * When talking to DemoCoreWeb, 4 cases failed. 15 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/SpecialTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class SpecialTypesFixture : BasicHttpClient 6 | { 7 | public SpecialTypesFixture() 8 | { 9 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 10 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 11 | Api = new DemoCoreWeb.Controllers.Client.SpecialTypes(HttpClient); 12 | } 13 | 14 | public DemoCoreWeb.Controllers.Client.SpecialTypes Api { get; private set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/SuperDemoFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | using System; 3 | 4 | namespace IntegrationTests 5 | { 6 | public class SuperDemoFixture : BasicHttpClient 7 | { 8 | public SuperDemoFixture() 9 | { 10 | Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() 11 | { 12 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 13 | }; 14 | 15 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 16 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 17 | Api = new DemoWebApi.Controllers.Client.SuperDemo(HttpClient, jsonSerializerSettings); 18 | } 19 | 20 | public DemoWebApi.Controllers.Client.SuperDemo Api { get; private set; } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/TupleFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | using Fonlow.DateOnlyExtensions; 3 | 4 | namespace IntegrationTests 5 | { 6 | public class TupleFixture : BasicHttpClient 7 | { 8 | public TupleFixture() 9 | { 10 | Newtonsoft.Json.JsonSerializerSettings jsonSerializerSettings = new Newtonsoft.Json.JsonSerializerSettings() 11 | { 12 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 13 | }; 14 | 15 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); //not needed in ASP.NET 7 16 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 17 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 18 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 19 | Api = new DemoWebApi.Controllers.Client.Tuple(HttpClient, jsonSerializerSettings); 20 | } 21 | 22 | public DemoWebApi.Controllers.Client.Tuple Api { get; private set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsCore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing": { 3 | "ServiceCommands": { 4 | "LaunchWebApi": { 5 | "CommandPath": "dotnet", 6 | "Arguments": "run --project ../../../../../DemoCoreWeb/DemoCoreWeb.csproj --no-build --configuration {BuildConfiguration}", 7 | "BaseUrl": "http://127.0.0.1:5000/", 8 | "Delay": 5 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Tests/IntegrationTestsNF/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsNF/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("BrokerProductionNfTests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("BrokerProductionNfTests")] 10 | [assembly: AssemblyCopyright("Copyright © 2022")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("81ffd489-803b-442a-9830-f52368b86803")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsNF/ReadMe.MD: -------------------------------------------------------------------------------- 1 | This is to test with .NET Framework clients. 2 | 3 | **Remarks:** 4 | 5 | Retired in Feb, 2024. -------------------------------------------------------------------------------- /Tests/IntegrationTestsNF/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/BigIntConverter.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | using System.Numerics; 3 | using System.Text.Json; 4 | using System.Text.Json.Serialization; 5 | 6 | namespace DemoTextJsonWeb 7 | { 8 | public class BigIntegerConverter : JsonConverter 9 | { 10 | // Inspired by https://stackoverflow.com/questions/64788895/serialising-biginteger-using-system-text-json 11 | public override BigInteger Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) 12 | { 13 | if (reader.TokenType == JsonTokenType.Number) 14 | { 15 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 16 | string rawText = doc.RootElement.GetRawText(); 17 | return BigInteger.Parse(rawText, NumberFormatInfo.InvariantInfo); 18 | 19 | } 20 | else if (reader.TokenType == JsonTokenType.String) 21 | { 22 | using JsonDocument doc = JsonDocument.ParseValue(ref reader); 23 | string text = doc.RootElement.GetString(); 24 | return BigInteger.Parse(text, NumberFormatInfo.InvariantInfo); 25 | } 26 | 27 | throw new JsonException(string.Format("Found token {0} but expected token {1}", reader.TokenType, JsonTokenType.Number)); 28 | } 29 | 30 | public override void Write(Utf8JsonWriter writer, BigInteger value, JsonSerializerOptions options) => 31 | writer.WriteRawValue(value.ToString(NumberFormatInfo.InvariantInfo), false); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/DateTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class DateTypesFixture : BasicHttpClient 6 | { 7 | public DateTypesFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, 12 | PropertyNameCaseInsensitive = true, 13 | }; 14 | 15 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); for .NET 6, no need in .NET 7, 8, 16 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 17 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 18 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 19 | Api = new DemoWebApi.Controllers.Client.DateTypes(HttpClient, jsonSerializerSettings); 20 | } 21 | 22 | public DemoWebApi.Controllers.Client.DateTypes Api { get; private set; } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/EntitiesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | /* 6 | And make sure the testApi credential exists through 7 | POST to http://localhost:10965/api/Account/Register 8 | Content-Type: application/json 9 | 10 | { 11 | Email: 'testapi@test.com', 12 | Password: 'Tttttttt_8', 13 | ConfirmPassword: 'Tttttttt_8' 14 | } 15 | 16 | */ 17 | public class EntitiesFixture : BasicHttpClient 18 | { 19 | public EntitiesFixture() 20 | { 21 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web) 22 | { 23 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, 24 | //PropertyNameCaseInsensitive = true, 25 | //NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString, // newtonsoft.json along with converters may return long and int128 as string 26 | }; 27 | 28 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); //not needed in ASP.NET 7 29 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 30 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 31 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 32 | Api = new DemoWebApi.Controllers.Client.Entities(HttpClient, jsonSerializerSettings); 33 | } 34 | 35 | public DemoWebApi.Controllers.Client.Entities Api { get; private set; } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/HeroesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class HeroesFixture : BasicHttpClient 6 | { 7 | public HeroesFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault, 12 | PropertyNameCaseInsensitive = true, 13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString, // newtonsoft.json along with converters may return long and int128 as string 14 | }; 15 | 16 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); 17 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 18 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 19 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 20 | Api = new DemoWebApi.Controllers.Client.Heroes(HttpClient, jsonSerializerSettings); 21 | } 22 | 23 | public DemoWebApi.Controllers.Client.Heroes Api { get; private set; } 24 | } 25 | 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/NumbersFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class NumbersFixture : BasicHttpClient 6 | { 7 | public NumbersFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web) 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault, 12 | PropertyNameCaseInsensitive = true, 13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString | System.Text.Json.Serialization.JsonNumberHandling.WriteAsString 14 | }; 15 | 16 | jsonSerializerSettings.Converters.Add(new DemoTextJsonWeb.BigIntegerConverter()); // both client and service must have the same conversion. 17 | 18 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 19 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 20 | Api = new DemoWebApi.Controllers.Client.Numbers(HttpClient, jsonSerializerSettings); 21 | } 22 | 23 | public DemoWebApi.Controllers.Client.Numbers Api { get; private set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/PolymorphismFixture.cs: -------------------------------------------------------------------------------- 1 | //using DemoCoreWeb.ClientApiTextJson; 2 | //using Fonlow.Testing; 3 | //using Fonlow.Text.Json.Auth; 4 | 5 | //namespace IntegrationTests 6 | //{ 7 | // public class PolymorphismFixture : BasicHttpClient 8 | // { 9 | // public PolymorphismFixture() 10 | // { 11 | // System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web) 12 | // { 13 | // DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, 14 | // }; 15 | // jsonSerializerSettings.Converters.Add(new TokenRequestConverter()); 16 | 17 | // var c = TestingSettings.Instance.ServiceCommands[0]; 18 | // this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 19 | // Api = new PolymorphismClient(HttpClient, jsonSerializerSettings); 20 | // } 21 | 22 | // public PolymorphismClient Api { get; private set; } 23 | // } 24 | 25 | //} 26 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/README.md: -------------------------------------------------------------------------------- 1 | For testing the runtime behavior of .NET Core Client API codes utilizing System.Text.Json rather than Newtonsoft.Json. 2 | 3 | The primary test endpoint is DemoTextJsonWeb. And DemoCoreWeb that uses Newtonsoft.Json should be used as well from time to time. 4 | 5 | **Hints:** 6 | 7 | * When testing with DemoCoreWeb, just launch DemoCoreWeb first, then the auto launch of DemoTextJsonWeb will fail, and the test suite will actually talk to DemoCoreWeb. 8 | 9 | 10 | **Remarks:** 11 | 12 | * As of .NET 3, 5, 6, 7 and 8, System.Text.Json has been approaching total replacement of Newtonsoft.Json, covering more and more CLR strongly typed data models. 13 | * However, as of .NET 8, there are still around 6 test cases failed revealing that what System.Text.Json is not yet capable of, when talking to DemoTextJsonWeb. Please read the doc documents of failed cases for details. 14 | * When talking to DemoCoreWeb, 4 cases failed. 15 | * Class TextJsonNegativeCases documents the behaviors of system.text.json.JsonSerilizer, related to the failed integration test cases. 16 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/SpecialTypesFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class SpecialTypesFixture : BasicHttpClient 6 | { 7 | public SpecialTypesFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions(System.Text.Json.JsonSerializerDefaults.Web) 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull, 12 | }; 13 | 14 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 15 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 16 | Api = new DemoCoreWeb.Controllers.Client.SpecialTypes(HttpClient, jsonSerializerSettings); 17 | } 18 | 19 | public DemoCoreWeb.Controllers.Client.SpecialTypes Api { get; private set; } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/SuperDemoFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class SuperDemoFixture : BasicHttpClient 6 | { 7 | public SuperDemoFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault, 12 | PropertyNameCaseInsensitive = true, 13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString 14 | }; 15 | 16 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 17 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 18 | Api = new DemoWebApi.Controllers.Client.SuperDemo(HttpClient, jsonSerializerSettings); 19 | } 20 | 21 | public DemoWebApi.Controllers.Client.SuperDemo Api { get; private set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/TupleFixture.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Testing; 2 | 3 | namespace IntegrationTests 4 | { 5 | public class TupleFixture : BasicHttpClient 6 | { 7 | public TupleFixture() 8 | { 9 | System.Text.Json.JsonSerializerOptions jsonSerializerSettings = new System.Text.Json.JsonSerializerOptions() 10 | { 11 | DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault, 12 | PropertyNameCaseInsensitive = true, 13 | NumberHandling = System.Text.Json.Serialization.JsonNumberHandling.AllowReadingFromString 14 | }; 15 | 16 | //jsonSerializerSettings.Converters.Add(new DateOnlyJsonConverter()); //not needed in ASP.NET 7 17 | //jsonSerializerSettings.Converters.Add(new DateOnlyNullableJsonConverter()); 18 | var c = TestingSettings.Instance.ServiceCommands["LaunchWebApi"]; 19 | this.HttpClient.BaseAddress = new System.Uri(c.BaseUrl); 20 | Api = new DemoWebApi.Controllers.Client.Tuple(HttpClient, jsonSerializerSettings); 21 | } 22 | 23 | public DemoWebApi.Controllers.Client.Tuple Api { get; private set; } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Tests/IntegrationTestsTextJson/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Testing": { 3 | "ServiceCommands": { 4 | "LaunchWebApi": { 5 | "CommandPath": "dotnet", 6 | "Arguments": "run --project ../../../../../DemoTextJsonWeb/DemoTextJsonWeb.csproj --no-build --configuration {BuildConfiguration} --launch-profile http", 7 | "BaseUrl": "http://127.0.0.1:6000/", 8 | "Delay": 5 9 | } 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /Tests/Poco2NgFormTests/GlobalUsings.cs: -------------------------------------------------------------------------------- 1 | global using Xunit; -------------------------------------------------------------------------------- /Tests/Poco2NgFormTests/Poco2NgFormTests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | false 9 | true 10 | 11 | 12 | 13 | 14 | 15 | 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | all 18 | 19 | 20 | runtime; build; native; contentfiles; analyzers; buildtransitive 21 | all 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Tests/Poco2TsTestsCore/DocCommentTests.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.DocComment; 2 | using Xunit; 3 | 4 | namespace Poco2TsTests 5 | { 6 | public class DocCommentTest 7 | { 8 | [Fact] 9 | public void TestReadDocComment() 10 | { 11 | DocCommentLookup d = DocCommentLookup.Create(@"DemoCoreWebControllers.xml"); 12 | Assert.NotNull(d); 13 | Assert.Equal("DemoCoreWebControllers", d.XmlDoc.assembly.name); 14 | docMemberSummary summary = d.GetMember("T:DemoWebApi.Controllers.HeroesController").summary; 15 | 16 | const string expected = "\n Heroes operations. Decorated by nullable directive.\n "; 17 | Assert.Equal(expected, summary.Text[0]); 18 | 19 | } 20 | 21 | [Fact] 22 | public void TestReadNotExist() 23 | { 24 | DocCommentLookup r = DocCommentLookup.Create(@"C:\VsProjects\webapiclientgen\NotExist\App_Data\xmlDocument.xml"); 25 | Assert.Null(r); 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tests/Poco2TsTestsCore/FooTypes.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.ComponentModel.DataAnnotations; 5 | using System.Linq; 6 | using System.Runtime.Serialization; 7 | using System.Text; 8 | using System.Text.Json.Serialization; 9 | using System.Threading.Tasks; 10 | 11 | namespace Poco2TsTestsCore 12 | { 13 | [DataContract] 14 | public class FooPerson 15 | { 16 | [DataMember] 17 | public string Surname { get; set; } 18 | public string GivenName { get; set; } 19 | } 20 | 21 | [JsonObjectAttribute(MemberSerialization = MemberSerialization.OptIn)] 22 | public class JsonPropertyPerson 23 | { 24 | [JsonProperty] 25 | public string Surname { get; set; } 26 | public string GivenName { get; set; } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Tests/Poco2TsTestsCore/NewtonsoftCherryPickingFacts.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Reflection; 4 | using Xunit; 5 | using Newtonsoft.Json; 6 | using DemoWebApi.DemoData; 7 | using System.Runtime.Serialization; 8 | using Poco2TsTestsCore; 9 | 10 | namespace Poco2TsTests 11 | { 12 | public class NewtonsoftCherryPickingFacts 13 | { 14 | static readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings() 15 | { 16 | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, 17 | }; 18 | 19 | [Fact] 20 | public void TestPerson() 21 | { 22 | var p = new Person() 23 | { 24 | Surname = "Someone" 25 | }; 26 | var serializer = JsonSerializer.Create(); 27 | var s = JsonConvert.SerializeObject(p, serializerSettings); 28 | Assert.Equal("{\"Surname\":\"Someone\",\"Addresses\":[]}", s); 29 | } 30 | 31 | [Fact] 32 | public void TestFooPerson() 33 | { 34 | var p = new FooPerson() 35 | { 36 | Surname = "Smith", 37 | GivenName = "John", 38 | }; 39 | var serializer = JsonSerializer.Create(); 40 | var s = JsonConvert.SerializeObject(p, serializerSettings); 41 | Assert.Equal("{\"Surname\":\"Smith\"}", s); 42 | } 43 | 44 | [Fact] 45 | public void TestJsonPropertyPerson() 46 | { 47 | var p = new JsonPropertyPerson() 48 | { 49 | Surname = "Smith", 50 | GivenName = "John" 51 | }; 52 | var serializer = JsonSerializer.Create(); 53 | var s = JsonConvert.SerializeObject(p, serializerSettings); 54 | Assert.Equal("{\"Surname\":\"Smith\"}", s); 55 | } 56 | 57 | 58 | 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Tests/Poco2TsTestsCore/Poco2TsTestsCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | 6 | false 7 | 8 | 2.0.0 9 | 10 | latest-minimum 11 | 12 | 13 | 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | PreserveNewest 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /Tests/Poco2TsTestsCore/TypeHelperTests.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using Xunit; 3 | using Fonlow.Reflection; 4 | using System; 5 | using Fonlow.Poco2Client; 6 | 7 | namespace Poco2TsTests 8 | { 9 | public partial class TypeHelperTests 10 | { 11 | 12 | [Fact] 13 | public void TestIAsyncEnumerable() 14 | { 15 | Assert.Equal("System.Collections.Generic.IAsyncEnumerable`1", typeof(IAsyncEnumerable<>).FullName); 16 | } 17 | 18 | [Fact] 19 | public void TestTitleCase() 20 | { 21 | System.Globalization.TextInfo textInfo = new System.Globalization.CultureInfo("en-US", false).TextInfo; 22 | Assert.Equal("Get", textInfo.ToTitleCase("GET".ToLower())); 23 | } 24 | 25 | [Fact] 26 | public void TestGuid() 27 | { 28 | Type type = typeof(Guid); 29 | Assert.True(TypeHelper.IsValueType(type)); 30 | Assert.False(!TypeHelper.IsValueType(type) && !TypeHelper.IsNullablePrimitive(type)); 31 | } 32 | 33 | [Fact] 34 | public void TestFindGeneric(){ 35 | Type t = PodGenHelper.FindGenericTypeDef(this.GetType().Assembly, "Poco2TsTests.MyGeneric`2"); 36 | Assert.NotNull(t); 37 | } 38 | 39 | } 40 | 41 | public class MyGeneric 42 | { 43 | public string MyName { get; set; } 44 | public T MyT { get; set; } 45 | public Y MyY { get; set; } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Tests/TypeScriptCodeDomTestsCore/TypeScriptCodeDomTestsCore.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net8.0 5 | 6 | false 7 | 8 | 2.0.0 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /UpgradeLog.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/UpgradeLog.htm -------------------------------------------------------------------------------- /UpgradeLog2.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/UpgradeLog2.htm -------------------------------------------------------------------------------- /WebApiClientGen.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/WebApiClientGen.snk -------------------------------------------------------------------------------- /WebApiClientGenCore.Abstract/ClientApiTsFunctionGenBase.cs: -------------------------------------------------------------------------------- 1 | using Fonlow.Web.Meta; 2 | 3 | namespace Fonlow.CodeDom.Web.Ts 4 | { 5 | public abstract class ClientApiTsFunctionGenBase : ClientApiTsFunctionGenAbstract 6 | { 7 | protected override string CreateUriQueryForTs(string uriText, ParameterDescription[] parameterDescriptions) 8 | { 9 | return UriQueryHelper.CreateUriQueryForTs(uriText, parameterDescriptions); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /WebApiClientGenCore.Abstract/GlobalSuppressions.cs: -------------------------------------------------------------------------------- 1 | // This file is used by Code Analysis to maintain SuppressMessage 2 | // attributes that are applied to this project. 3 | // Project-level suppressions either have no target or are given 4 | // a specific target and scoped to a namespace, type, member, etc. 5 | 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | [assembly: SuppressMessage("Naming", "CA1711:Identifiers should not have incorrect suffix", Justification = "", Scope = "type", Target = "~T:Fonlow.CodeDom.CodeNamespaceEx")] 9 | [assembly: SuppressMessage("Maintainability", "CA1508:Avoid dead conditional code", Justification = "", Scope = "member", Target = "~M:Fonlow.CodeDom.Web.Ts.ClientApiTsFunctionGenAbstract.GetFullUriText~System.String")] 10 | -------------------------------------------------------------------------------- /WebApiClientGenCore.Abstract/README.md: -------------------------------------------------------------------------------- 1 | Abstract classes and common classes shared by WebApiClientGenCore and its plugins. 2 | 3 | https://github.com/zijianhuang/webapiclientgen/ -------------------------------------------------------------------------------- /WebApiClientGenCore.Abstract/WebApiDocSingleton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Fonlow.CodeDom.Web 4 | { 5 | /// 6 | /// Store the doc comment of the Web API assembly. 7 | /// 8 | public sealed class WebApiDocSingleton 9 | { 10 | private static readonly Lazy lazy = 11 | new(() => new WebApiDocSingleton()); 12 | 13 | public static WebApiDocSingleton Instance { get { return lazy.Value; } } 14 | 15 | public static WebApiDocSingleton InitOnce(Fonlow.DocComment.DocCommentLookup lookup) 16 | { 17 | WebApiDocSingleton r = Instance; 18 | if (r.initialized) 19 | { 20 | return r; 21 | } 22 | 23 | r.initialized = true; 24 | 25 | r.Lookup = lookup; 26 | return r; 27 | } 28 | 29 | private bool initialized; 30 | /// 31 | /// It might be null if no doc comment for the Web API. 32 | /// 33 | public Fonlow.DocComment.DocCommentLookup Lookup { get; private set; } 34 | 35 | private WebApiDocSingleton() 36 | { 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /WebApiClientGenCore.Aurelia/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with Angular 2+. 2 | 3 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 4 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.Aurelia) 5 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/aurelia) 6 | * [Tour of the Heroes with Aurelia](https://github.com/zijianhuang/DemoCoreWeb/tree/master/AureliaHeroes) 7 | 8 | -------------------------------------------------------------------------------- /WebApiClientGenCore.Axios/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with AXIOS. 2 | 3 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 4 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.Axios) 5 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/axios) 6 | * [Tour of the Heroes with React TS](https://github.com/zijianhuang/DemoCoreWeb/tree/master/ReactHeroes) 7 | 8 | -------------------------------------------------------------------------------- /WebApiClientGenCore.Fetch/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with Fetch API. 2 | 3 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 4 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.Fetch) 5 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/fetchapi) 6 | -------------------------------------------------------------------------------- /WebApiClientGenCore.NG2/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with Angular 2+. 2 | 3 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 4 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.NG2) 5 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/HeroesDemo/src/clientapi) 6 | * [Tour of the Heroes with Angular 2+](https://github.com/zijianhuang/webapiclientgen/tree/master/HeroesDemo) 7 | 8 | -------------------------------------------------------------------------------- /WebApiClientGenCore.NG2FormGroup/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with Angular 2+, plus helper interfaces and functions for creating FormGroup of [Angular Reactive Forms](https://angular.io/guide/reactive-forms). 2 | 3 | * [Guidelines for using generated codes for Reactive Forms](https://github.com/zijianhuang/webapiclientgen/wiki/Angular-Reactive-Forms) 4 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 5 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.NG2) 6 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/HeroesDemo/src/clientapi) 7 | * [Tour of the Heroes with Angular 2+](https://github.com/zijianhuang/webapiclientgen/tree/master/HeroesDemo) 8 | 9 | -------------------------------------------------------------------------------- /WebApiClientGenCore.jQuery/README.md: -------------------------------------------------------------------------------- 1 | Plugin for WebApiClientGenCore 3.0+ to generate client API codes with Angular 2+. 2 | 3 | * [Project repository](https://github.com/zijianhuang/webapiclientgen/) 4 | * [Plugin source codes](https://github.com/zijianhuang/webapiclientgen/tree/master/WebApiClientGenCore.jQuery) 5 | * [Integration test suite](https://github.com/zijianhuang/webapiclientgen/tree/master/DemoCoreWeb/Scripts) 6 | 7 | -------------------------------------------------------------------------------- /WebApiClientGenCore/ApiExplorerVisibilityEnabledConvention.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.ApplicationModels; 2 | using System; 3 | 4 | namespace Fonlow.CodeDom.Web 5 | { 6 | /// 7 | /// To be added to MVC option convensions in startup.cs to make api explorers of controllers become visible. 8 | /// Opt-out approach comparing with ApiExplorerAttribute. 9 | /// Visible controlers are still subject to the filter defined in ApiSelections/ExcludedControllerNames in the POST payload of CodeGen. 10 | /// Thus controllers defined in the array will be excluded from generating client codes. 11 | /// 12 | public class ApiExplorerVisibilityEnabledConvention : IApplicationModelConvention 13 | { 14 | /// 15 | /// Make the ApiExplorer of each controller become visible, so the code gen could see them inside the controller. 16 | /// 17 | /// 18 | public void Apply(ApplicationModel application) 19 | { 20 | foreach (ControllerModel controller in application.Controllers) 21 | { 22 | if (controller.ApiExplorer.IsVisible == null) 23 | { 24 | controller.ApiExplorer.IsVisible = true; 25 | controller.ApiExplorer.GroupName = controller.ControllerName; 26 | } 27 | } 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /WebApiClientGenCore/CodeGenException.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.Serialization; 3 | 4 | namespace Fonlow.Web.Meta 5 | { 6 | [Serializable] 7 | public class CodeGenException : Exception 8 | { 9 | public CodeGenException() 10 | { 11 | 12 | } 13 | 14 | public CodeGenException(string message) : base(message) { } 15 | 16 | public CodeGenException(string message, Exception innerException) : base(message, innerException) { } 17 | 18 | public string Description { get; set; } 19 | } 20 | 21 | [Serializable] 22 | public class CodeGenLoadPluginException : CodeGenException 23 | { 24 | public CodeGenLoadPluginException() 25 | { 26 | 27 | } 28 | 29 | public CodeGenLoadPluginException(string message) : base(message) { } 30 | 31 | public CodeGenLoadPluginException(string message, Exception innerException) : base(message, innerException) { } 32 | } 33 | 34 | [Serializable] 35 | public class CodeGenReadPluginException : CodeGenException 36 | { 37 | public CodeGenReadPluginException() 38 | { 39 | 40 | } 41 | 42 | public CodeGenReadPluginException(string message) : base(message) { } 43 | 44 | public CodeGenReadPluginException(string message, Exception innerException) : base(message, innerException) { } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /WebApiClientGenCore/README.md: -------------------------------------------------------------------------------- 1 | Strongly Typed Client API Generators generate strongly typed client API in C# and in TypeScript for jQuery and Angular 2+. 2 | 3 | **Installation:** 4 | 5 | Step 0: Install NuGet package WebApiClientGenCore at https://www.nuget.org/packages/Fonlow.WebApiClientGenCore/ to your ASP.NET Core 2.0 Web MVC/API Project 6 | 7 | The installation will also install dependent NuGet packages Fonlow.TypeScriptCodeDOMCore and Fonlow.Poco2TsCore to the project references. 8 | 9 | After installing the NuGet packages, please follow the instructions at: 10 | https://www.codeproject.com/Articles/1243908/Generate-Csharp-Client-API-for-ASP-NET-Core-Web-AP 11 | 12 | **Documentations** 13 | 14 | * [WIKI](https://github.com/zijianhuang/webapiclientgen/wiki) 15 | * [Generate C# .NET Client API for ASP.NET Web API](https://www.codeproject.com/Articles/1074039/Generate-Csharp-Client-API-for-ASP-NET-Web-API) 16 | * [Generate TypeScript Client API for ASP.NET Web API](https://www.codeproject.com/articles/1053601/generate-typescript-client-api-for-asp-net-web-api) 17 | * [ASP.NET Web API, Angular2, TypeScript and WebApiClientGen](https://www.codeproject.com/Articles/1165571/ASP-NET-Web-API-Angular-TypeScript-and-WebApiClie) 18 | -------------------------------------------------------------------------------- /_DebugWeb/CodeGen.json: -------------------------------------------------------------------------------- 1 | { 2 | "ApiSelections": { 3 | "ExcludedControllerNames": [ 4 | "DemoWebApi.Controllers.Home", 5 | "DemoWebApi.Controllers.FileUpload" 6 | ], 7 | 8 | "DataModelAssemblyNames": [ "DemoGodAssemblyWeb" ], 9 | "CherryPickingMethods": 32 10 | }, 11 | 12 | "ClientApiOutputs": { 13 | "ClientLibraryProjectFolderName": "../DemoCoreWeb.ClientApiTextJson", 14 | "FileName": "WebApiClientTextJsonAuto.cs", 15 | "GenerateBothAsyncAndSync": true, 16 | "CamelCase": true, 17 | "CSClientNamespaceSuffix": ".Client", 18 | "DataAnnotationsEnabled": true, 19 | "DataAnnotationsToComments": true, 20 | "HandleHttpRequestHeaders": true, 21 | "DecorateDataModelWithDataContract": true, 22 | "DataContractNamespace": "http://fonlowdemo.com/2020/09", 23 | "DecorateDataModelWithSerializable": true, 24 | "IEnumerableToArray": false, 25 | "MaybeNullAttributeOnMethod": true, 26 | "UseEnsureSuccessStatusCodeEx": true, 27 | "IncludeEnsureSuccessStatusCodeExBlock": true, 28 | "JsMethodSuffixWithClrTypeName": true, 29 | 30 | "UseSystemTextJson": true, 31 | 32 | "Plugins": [ 33 | 34 | 35 | ] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /_DebugWeb/Controllers/DummyController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | using System.Net; 3 | using DemoWebApi.DemoData; 4 | using System.Diagnostics; 5 | 6 | namespace DebugWeb.Controllers 7 | { 8 | /// 9 | /// To contain API functions that the codegen hasn't support well, for new features or breaking changes or whatever broken 10 | /// 11 | [ApiController] 12 | [Route("[controller]")] 13 | public class DummyController : ControllerBase 14 | { 15 | [HttpPost] 16 | [Route("createPerson")] 17 | public Person CreatePerson([FromBody] Person p) 18 | { 19 | Debug.WriteLine("CreatePerson: " + p.Name); 20 | 21 | if (p.Name == "Exception") 22 | throw new InvalidOperationException("It is exception"); 23 | 24 | Debug.WriteLine("Create " + p); 25 | return p; 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /_DebugWeb/DebugWeb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | latest-minimum 7 | True 8 | False 9 | False 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /_DebugWeb/Program.cs: -------------------------------------------------------------------------------- 1 | string webRootPath = "./"; 2 | 3 | 4 | // WebRootPath is to tell the Web server where to look for files to serve. 5 | // ContentRootPath is to tell the Web service code where to look for data. 6 | // On Windows, ContentRootPath is the starting folder of the app assembly, and on MacOS, it is the user profile folder like //Users/MyName. 7 | // Thus on MacOS, the App_Data folder should be under the user profile folder. 8 | var options = new WebApplicationOptions 9 | { 10 | WebRootPath = webRootPath, 11 | Args = args, 12 | }; 13 | 14 | var builder = WebApplication.CreateBuilder(options); 15 | 16 | // Add services to the container. 17 | 18 | builder.Services.AddControllers(); 19 | 20 | var app = builder.Build(); 21 | 22 | // Configure the HTTP request pipeline. 23 | 24 | app.UseAuthorization(); 25 | 26 | app.MapControllers(); 27 | 28 | app.Run(); 29 | -------------------------------------------------------------------------------- /_DebugWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:34776", 8 | "sslPort": 0 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "weatherforecast", 17 | "applicationUrl": "http://localhost:5090", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "weatherforecast", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /_DebugWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /_DebugWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | }, 7 | "IncludeScopes": false, 8 | "Debug": { 9 | "LogLevel": { 10 | "Default": "Warning" 11 | } 12 | }, 13 | "Console": { 14 | "LogLevel": { 15 | "Default": "Information" 16 | } 17 | } 18 | }, 19 | 20 | "AllowedHosts": "*", 21 | 22 | "Kestrel": { 23 | "EndPoints": { 24 | "Http": { 25 | "Url": "http://localhost:5000" 26 | }, 27 | 28 | "HttpsDefaultCert": { 29 | "Url": "https://localhost:5001" 30 | } 31 | 32 | } 33 | 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /_DebugWebClientApi/DebugWebClientApi.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /aurelia/karma.conf.js: -------------------------------------------------------------------------------- 1 | module.exports = function (config) { 2 | config.set({ 3 | frameworks: ["jasmine", "karma-typescript"], 4 | files: [ 5 | { pattern: "node_modules/reflect-metadata/Reflect.js", include: true }, 6 | "src/**/*.ts" // *.tsx for React Jsx 7 | ], 8 | preprocessors: { 9 | "**/*.ts": "karma-typescript" // *.tsx for React Jsx 10 | }, 11 | karmaTypescriptConfig: { 12 | tsconfig: './tsconfig.json' 13 | }, 14 | reporters: ["kjhtml", "karma-typescript"], 15 | client: { 16 | clearContext: false // leave Jasmine Spec Runner output visible in browser 17 | }, 18 | browsers: ["Chrome"] 19 | }); 20 | 21 | process.on('infrastructure_error', (error) => { 22 | console.error('infrastructure_error', error); 23 | }); 24 | }; -------------------------------------------------------------------------------- /aurelia/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "aurelia-bootstrapper": "^2.4.0", 4 | "aurelia-fetch-client": "^1.8.2", 5 | "moment": "^2.30.1", 6 | "typescript": "5.2.2" 7 | }, 8 | "devDependencies": { 9 | "@types/jasmine": "^5.1.4", 10 | "jasmine-core": "^5.1.2", 11 | "karma": "^6.4.3", 12 | "karma-chrome-launcher": "^3.2.0", 13 | "karma-jasmine": "^5.1.0", 14 | "karma-jasmine-html-reporter": "^2.1.0", 15 | "karma-typescript": "^5.5.4", 16 | "reflect-metadata": "^0.2.1" 17 | } 18 | } -------------------------------------------------------------------------------- /aurelia/readme.txt: -------------------------------------------------------------------------------- 1 | To test, run: 2 | karma start ./karma.conf.js 3 | along with .net core web api. -------------------------------------------------------------------------------- /aurelia/runtest.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | karma start ./karma.conf.js -------------------------------------------------------------------------------- /aurelia/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "module": "commonjs", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "ES2020", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "ES2020", "DOM" 16 | ], 17 | "skipLibCheck": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /axios/README.md: -------------------------------------------------------------------------------- 1 | 1. Run Web API 2 | 2. Run `npx jest` to test 3 | -------------------------------------------------------------------------------- /axios/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "roots": [ 3 | "/src" 4 | ], 5 | moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'], 6 | preset: 'ts-jest', 7 | transform: { 8 | '^.+\\.tsx?$': ['ts-jest', {//the content you'd placed at "global" 9 | babel: true, 10 | tsconfig: 'tsconfig.json', 11 | }] 12 | }, 13 | } -------------------------------------------------------------------------------- /axios/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demoapp", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@types/node": "^20.11.29", 7 | "axios": "^1.6.8", 8 | "moment": "^2.30.1", 9 | "typescript": "5.2.2" 10 | }, 11 | "scripts": {}, 12 | "browserslist": { 13 | "production": [ 14 | ">0.2%", 15 | "not dead", 16 | "not op_mini all" 17 | ], 18 | "development": [ 19 | "last 3 chrome version", 20 | "last 3 firefox version", 21 | "last 3 safari version" 22 | ] 23 | }, 24 | "devDependencies": { 25 | "@types/jest": "^29.5.12", 26 | "jest": "^29.7.0", 27 | "ts-jest": "^29.1.2" 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /axios/runtest.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | npx jest -------------------------------------------------------------------------------- /axios/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | animation: App-logo-spin infinite 20s linear; 7 | height: 40vmin; 8 | pointer-events: none; 9 | } 10 | 11 | .App-header { 12 | background-color: #282c34; 13 | min-height: 100vh; 14 | display: flex; 15 | flex-direction: column; 16 | align-items: center; 17 | justify-content: center; 18 | font-size: calc(10px + 2vmin); 19 | color: white; 20 | } 21 | 22 | .App-link { 23 | color: #61dafb; 24 | } 25 | 26 | @keyframes App-logo-spin { 27 | from { 28 | transform: rotate(0deg); 29 | } 30 | to { 31 | transform: rotate(360deg); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /axios/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /axios/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "module": "commonjs", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "ES2020", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "ES2020", "DOM" 16 | ], 17 | "skipLibCheck": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /buildJqTests.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | 3 | #Step 3: Compile generated TS codes to JS for jQuery. https://www.typescriptlang.org/docs/handbook/compiler-options.html 4 | # make sure TS compiler is installed through npm install -g typescript, then tsc.ps1 is available in C:\Users\YourProfile\AppData\Roaming\npm 5 | Invoke-Expression "tsc.ps1 --target es2022 $PSScriptRoot\DemoCoreWeb\Scripts\ClientApi\WebApiCoreJQClientAuto.ts" 6 | Invoke-Expression "tsc.ps1 --target es2022 $PSScriptRoot\DemoCoreWeb\Scripts\tests\demo.tests.ts" 7 | Invoke-Expression "tsc.ps1 --target es2022 $PSScriptRoot\DemoCoreWeb\Scripts\tests\special.tests.ts" 8 | -------------------------------------------------------------------------------- /fetchapi/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "roots": [ 3 | "/src" 4 | ], 5 | moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx'], 6 | preset: 'ts-jest', 7 | transform: { 8 | '^.+\\.tsx?$': ['ts-jest', {//the content you'd placed at "global" 9 | babel: true, 10 | tsconfig: 'tsconfig.json', 11 | }] 12 | }, 13 | } -------------------------------------------------------------------------------- /fetchapi/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demoapp-fetchapi", 3 | "version": "0.1.0", 4 | "private": true, 5 | 6 | "dependencies": { 7 | "@types/node": "^20.14.2", 8 | "moment": "^2.30.1", 9 | "typescript": "5.4.5" 10 | }, 11 | 12 | "devDependencies": { 13 | "@types/jest": "^29.5.12", 14 | "jest": "^29.7.0", 15 | "ts-jest": "^29.1.4" 16 | } 17 | } -------------------------------------------------------------------------------- /fetchapi/readme.txt: -------------------------------------------------------------------------------- 1 | 1. Run Web API 2 | 2. Run `npx jest` to test -------------------------------------------------------------------------------- /fetchapi/runtest.ps1: -------------------------------------------------------------------------------- 1 | Set-Location $PSScriptRoot 2 | npx jest -------------------------------------------------------------------------------- /fetchapi/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "declaration": false, 6 | "moduleResolution": "node", 7 | "module": "commonjs", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "ES2020", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "ES2020", "DOM" 16 | ], 17 | "skipLibCheck": true 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ 3 | "wrap" 4 | ] 5 | } -------------------------------------------------------------------------------- /license.md: -------------------------------------------------------------------------------- 1 | MIT 2 | Copyright (c) 2015 Zijian Huang 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /webapiclientgen.smproj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zijianhuang/webapiclientgen/44b9ef699c85721bb80413b3dd5fe2f58419ea0c/webapiclientgen.smproj --------------------------------------------------------------------------------