This project has moved. For the latest updates, please go here.
Visual Studio, WCF and ASP.NET Web API are essentially productivity tools, and there's nothing to stop you from creating .NET RESTful Web services using only a free .NET compiler and Windows Notepad.

When creating WCF Web applications and ASP.NET Web API applications, Visual Studio may create nice scaffolding codes so you may add business features, and deliver business values ASAP. However, as the system needs to evolve, the default structures of the scaffolding codes may not be adequate for managing the growing complexity.

You might need some well defined complexity (design patterns and guidelines) to manage the uncertain growing complexity.

If you have the following views/habits/preferences of designing Web API applications, you may find it is easier to use this code generator.

Keep the Web API project as thin as possible

Web services, SOAP base or RESTful are generally just a transportation for delivering server side API to the client side. It is good for team work and testing to put most if not all the business logic into the model assemblies rather than in the Web API project.

Keep Plain Old Data classes in some dedicated assemblies

Even if you are not developing a WCF application but Web API, decorating some classes with DataContractAttribute may have the following benefits:
  1. Declare/document your intention of exposing some classes to the outside worlds, and expose class properties of client only concerns.
  2. DataContract serialization is cleaner than XML serialization for POD in .NET, and the client proxy classes generated are less verbose.
  3. Comprehensive controls of namespaces on both server side and client side.
  4. Easy for code reuse at the component/assembly level.

While using DataContractAttribute is highly recommended, however, if you have already been using JsonObjectAttribute of Newtonsoft.Json, the CodeGen could take care of it as well for cherry-picking.

With adequate separation of concerns and component designs, the Visual Studio IDE will be working faster and more reliable during design time, especially when you are using a lot cshtml or vbhtml.

Last edited Nov 22, 2015 at 11:55 PM by zijianhuang, version 5