Strongly Typed Client API Generators generate strongly typed client API in C# codes and TypeScript codes. This repository contains code examples explained in the following CodeProject.com articles:
- Generate C# Client API for ASP.NET Web API
- Generate TypeScript Client API for ASP.NET Web API
- ASP.NET Web API, Angular2, TypeScript and WebApiClientGen
And this repository contains 2 demo applications:
- DemoAngular2, an Angular 2+ applications based on the Heroes example in Angular's tutorial Website.
- Fonlow.Heroes.Android, a Xamarin.Forms application mimicking the Heroes example in Angular's tutorial Website.
Both applications consume the same Web API through the client API codes generated by WebApiClientGen.
This VS solution was constructed using Visual Studio 2015-2017.
- .NET Framework 4.6.2
- ASP.NET Web API 2.2
.NET client side:
- .NET Framework 4.6.2, or Universal Windows, or Xamarin.Android, or Xamarin.iOS
- ASP.NET Web API 2.2 Client Libraries
- Json.NET of Newtonsoft for Content-Type application/json
- Microsoft Build Tools 2015
TypeScript client side:
- TypeScript compiler 2.6
- Angular 2/4/5 and its dependencies in node_modules supported by Node.js and npm.
- tag "withWebApiClientGen22" is with WebApiClientGen v2.2 and Angular 4.3
- tag "NG522" is with WebapiClientGen v2.4.4 and Angular 5
- Current trunk is similar to tag "NG522
- The Android mobile app is talking to the Web API, however the base URI http://192.168.0.2:9030/webapi/ is hard-coded in HeroesFunction. So you may need to alter the base URI in codes in order to run the app successfuly in either Android devices or emulators, after you have deployed the Web API to IIS.
Testing on Browsers and Mobile Devices
Special thanks to the support of BrowserStack so real cross browser testing on multiple desktop and mobile platforms as well is possible. And App Live supports testing Android apps and iOS apps on rich collections of real Android and iOS devices.