011 First Web Api Service (PhoneType) - chempkovsky/CS82ANGULAR GitHub Wiki

Requirements

  • Before generating WebApi service the developer must define the set of View’s properties that
    • will be used for filtering
  • and the set of View’s properties that
    • will be used for sorting.
  • choose which Webapi methods to generate (Add/Update/Delete/Select One/Select many) for the given view

Steps required to accomplish the task

Run WebApi Wizard
  • To Generate Web Api service
    • Run Visual Studio and Open PhonebookSolution solution
    • Right Click Controllers of the PhBkControllers-project and select WebApiServices Wizard menu item to open the Wizard dialog
Click to show the picture

project structure

First page of the Wizard

  • On the first page of the dialog the destination folder is shown. The destination folder is the folder in which the generated file will be created. Click Next-button
Click to show the picture

project structure

Second page of the Wizard

  • On the second page of the Wizard we select DbContext that will be used to choose the entity for the View. Select PhBkContext.csproj and the PhBkContext class using the drop-down lists. Click Next-button.
Click to show the picture

project structure

Third page of the Wizard

  • On the third page of the Wizard
      1. select View
      1. choose the props to be used for sorting and filtering
      1. choose WebApi methods to generate
      1. if to generate localized typescript code-CheckBox using Angular i18n
  • Click Next-button
Click to show the picture

project structure

Fourth page of the Wizard

  • On the Fourth page of the Wizard we choose DefaultWebApiService.Core.cs.t4 T4-template to generate the code. Click Next-button.

Fifth page of the Wizard

  • On the Fifth page of the Wizard click Save-button. Close the Wizard.
Click to show the picture

project structure

The PhbkPhoneTypeViewWebApiController.cs will be created in the Controllers-folder of the PhBkWebApp.csproj-project

⚠️ **GitHub.com Fallback** ⚠️