Skip to content
Strongly Typed Client API Generators generate strongly typed client APIs in C# .NET and in TypeScript for jQuery and Angular 2+ from ASP.NET Web API and .NET Core Web API
Branch: master
Clone or download
Latest commit 21d9508 Feb 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
3rdParty/EssentialDiagnostics
DemoAngular2 DemoAngular2 is not actively maintained but GitHub complaining the lo… Oct 5, 2018
DemoCoreWeb.ClientApi
DemoCoreWeb tlint happy published Dec 6, 2018
DemoNGCli upgraded to ng 7.2.4 and ts 3.2.2 Feb 13, 2019
DemoWebApi.AndroidClientApi
DemoWebApi.ClientApi minor fix Dec 5, 2018
DemoWebApi.DemoData
DemoWebApi.DemoDataCore
DemoWebApi.DemoDataShared ready to release Sep 1, 2018
DemoWebApi.PortableClientApi
DemoWebApi.UniversalClientApi
DemoWebApi.iOSClientApi
DemoWebApi
Doc
Fonlow.DocComment
Fonlow.DocCommentCore all to core 2.2 Jan 30, 2019
Fonlow.DocCommentShared
Fonlow.Poco2Ts tlint happy published Dec 6, 2018
Fonlow.Poco2TsCore tlint happy published Dec 6, 2018
Fonlow.Poco2TsShared ready to release Sep 1, 2018
Fonlow.TypeScriptCodeDom iconurl Feb 18, 2019
Fonlow.TypeScriptCodeDomCore
Fonlow.TypeScriptCodeDomShared minor fix Dec 5, 2018
Fonlow.Web.Meta reconstruction and fixing issue #49 Aug 23, 2018
Fonlow.Web.MetaCore all to core 2.2 Jan 30, 2019
Fonlow.Web.MetaShared bug fixes May 6, 2018
Poco2Ts
Poco2TsCore tlint happy published Dec 6, 2018
Poco2TsShared more to .net core Apr 28, 2018
Tests
WebApiClientGen tlint happy published Dec 6, 2018
WebApiClientGenCore
WebApiClientGenShared Update ClientApiFunctionGen.cs Jan 11, 2019
.gitignore upgraded to ng 7.2.4 and ts 3.2.2 Feb 13, 2019
CreateAspNetCoreClientApi.ps1 tlint happy published Dec 6, 2018
CreateClientApi.ps1 improved ps1 files May 21, 2018
Fonlow.ruleset
Readme.md Two small typos Feb 15, 2019
ReleaseBuild.bat
SolutionInfo.cs update packages Jun 1, 2017
StartDemoCoreWeb.ps1
StartDemoWebApi.ps1 warm up Nov 14, 2016
StartNG2.ps1
StartNGCli.ps1
WebApiClientGen.msbuild published 2.0.1 Dec 26, 2016
WebApiClientGen.sln
WebApiClientGen.snk small fix Oct 20, 2015
global.json
license.md Add files via upload Apr 7, 2017
webapiclientgen.smproj

Readme.md

Strongly Typed Client API Generators generate strongly typed client API in C# codes and TypeScript codes. You may then provide or publish either the generated source codes or the compiled client API libraries to other developers for developing client programs.

This project delivers these products:

  1. Code generator for strongly typed client API in C# supporting desktop, Universal Windows, Android and iOS.
  2. Code generator for strongly typed client API in TypeScript for jQuery and Angular 2.
  3. TypeScript CodeDOM, a CodeDOM component for TypeScript, derived from CodeDOM of .NET Framework.
  4. POCO2TS.exe, a command line program that generates TypeScript interfaces from POCO classes.
  5. Fonlow.Poco2Ts, a component that generates TypeScript interfaces from POCO classes.

Packages

Hints:

  • The packages could be used independently as long as the usages conform to the dependencies.

Key Features

  1. Client API codes generated are directly mapped from the Web API controller methods, .NET primitive types and POCO classes. This is similar to what svcutil.exe in WCF has offered.
  2. Doc comments of controller methods and POCO classes are copied.

Key Benefits

  1. WebApiClientGen is seamlessly integrated with ASP.NET Web API with very little steps/overheads to setup, maintain and synchronize between Web API and client APIs, during RAD or Agile Software Development.
  2. Support all .NET primitive types including decimal.
  3. Support DataTime, DataTimeOffset, Array, Tuple, Dynamic Object, Dictionary and KeyValuePair
  4. Strongly typed generated codes are subject to design time type checking and compile time type checking.
  5. Provide high level of abstraction, shielding application developers from repetitive technical details of RESTful practices and traditional AJAX calls.
  6. Rich meta info including doc comments make IDE intellisense more helpful, so application developers have less need of reading separated API documents.

Examples

  1. POCO classes
  2. Web API
  3. Generated client API C# codes
  4. Client codes using the generated library in C#
  5. Generated client data models and API in TypeScript for jQuery and for Angular 2
  6. Client codes using the generated library in TypeScript

Downloads

For .NET Framework

  1. Strongly Typed Client API Generators for ASP.NET Web API.
  2. TypeScript CodeDOM
  3. POCO2TS.exe
  4. Fonlow.Poco2TS

For .NET Core

  1. Strongly Typed Client API Generators for ASP.NET Core Web API.
  2. TypeScript CodeDOM
  3. Fonlow.Poco2TS

Concepts

  1. Web API vendors / developers should provide client API libraries to developers of client programs, as Google and Amazon etc. would do in order to make the RESTful Web API reach wider consumers (internal and external) efficiently.
  2. To client developers, classic function prototypes like ReturnType DoSomething(Type1 t1, Type2 t2 ...) is the API function, and the rest is the technical implementation details of transportations: TCP/IP, HTTP, SOAP, resource-oriented, CRUD-based URIs, RESTful, XML and JSON etc. The function prototype and a piece of API document should be good enough for calling the API function.
  3. The better you have separation of concerns in your Web API design, the more you will benefit from the components of this project in order to deliver business values sooner, with less handcrafted codes , less repetitive tasks and less chances of human mistakes.

Prerequisites

Server side:

  1. .NET Framework 4.5.2, or .NET Core 2.0
  2. ASP.NET Web API 2.2, or ASP.NET Core 2.0

.NET client side:

  1. .NET Framework 4.5.2, or Universal Windows, or Mono.Android, or Xamarin.iOS, or .NET Core 2.0/2.1
  2. ASP.NET Web API 2.2 Client Libraries
  3. Json.NET of Newtonsoft for Content-Type application/json
  4. Microsoft Build Tools 2015

TypeScript client side:

  1. TypeScript compiler
  2. jQuery
  3. Angular 2/4/5/6 and its dependencies in node_modules supported by Node.js and npm.

For more details, please check WIKI, and codeproject.com articles at:

  1. Generate C# .NET Client API for ASP.NET Web API
  2. Generate TypeScript Client API for ASP.NET Web API
  3. ASP.NET Web API, Angular2, TypeScript and WebApiClientGen
  4. Generate C# Client API for ASP.NET Core Web API

Demo Applications

The Demo applications in this repository are mainly for testing WebApiClientGen during development. And there are other demo applications in the following repositories, demostrating how real world applications could utilize WebApiClientGen:

  1. WebApiClientGen Examples
  2. .NET Core Demo

These demo applications are actively maintained and kept up-to-date with the latest frameworks. If you are still staying with some older frameworks like Angular 4 or 5 or .NET Core 2.0, you may navigate to respective tags of the repositories and checkout.

You can’t perform that action at this time.