![]() This installs the package along with a few dependent NuGet packages (which I'll discuss more later). The first step is to execute the install for this package: PM> Install-Package WebApi.Scaffolding You can start with the "Empty ASP.NET Web Application" project if you want to follow this step by step. I have created a NuGet package called WebApi.Scaffolding. I'll start with the end result and then discuss the implementation. It only created a single service – so if you want to create a second service, it was a copy/paste exercise.īy leveraging T4Scaffolding, we can address all of these issues.You have to manually specify the route you want.You have to manually rename the Service class.You have to manually move the model type to its own code file.It created a dummy "MyModelType" class where you had to then rely on Visual Studio refactoring tools to perform a "rename" operation everywhere.State was held by a static in-memory dictionary which, while good for a demo, you have to replace.However, there are several aspects of the NuGet-only approach that are not ideal: This consisted of a NuGet package which added the appropriate references and provided starter code for a basic HTTP CRUD service (I included a 6-minute screencast showing it in action). Recently I did a post that showed how easy it was to get up and running with Web API by leveraging NuGet. To that end, we can enjoy the same power of MvcScaffolding in non-MVC projects like the WCF Web API. T4Scaffolding can be used as the basis for any scaffolding – not just MVC projects. The best part about the scaffolding infrastructure is that MvcScaffolding is actually built on top of another package called T4Scaffolding. Earlier this year, Steve Sanderson posted the definitive 7-part series on MvcScaffolding which is a must-read for anyone serious about doing scaffolding. MvcScaffolding is a tremendous productivity improvement for MVC developers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |