037 Classes used for interservice communication for Lookup Resource of PhbkDivision - chempkovsky/CS82ANGULAR GitHub Wiki

Notes

  • According to the requirements 033 Lookup Resource should be updated automatically in async mode.
    • This means that information about changing any row of PhbkDivisionView data must be sent to the lookup resource-service.
      • so our next goal is to define classes and interfaces that describe the structures to be send to the lookup resource-service.
      • it will be done with JavaSripts-Wizard. With JavaSripts-Wizard you can create (generate) not only Typescript files but the files of any type including C# files. At the time of saving the generated file JavaSripts-Wizard updates the Wizard's repo.
        • Open the article 036. We created many Entities and modified the DbContext file. But in the end, we removed all modifications from the project with the #if (!NOTMODELING) ... #endif-operator.
        • This activity looks too strange. But we solved two subtasks: first, we updated the Wizard's repo for further actions, and second, we documented the steps we took. Both aspects are extremely important. Moreover, the deleted entities code with minimal changes will be used later, because we need access to the database of the lookup resource. The minimum changes mentioned are the removal of extra foreign keys.

Steps required to accomplish the task

01005 extforlkup interface for PhbkDivisionView

Run JavaSripts Wizard for extforlkup

  • To run 01005-.extforlkup.interface.cs-script
    • Run Visual Studio and Open “PhonebookSolution” solution
    • Right Click “PhBk” of the LpPhBkViews-project and select JavaSripts Wizard-menu item to open the Wizard dialog
      • Note: LpPhBkViews-project is used instead of PhBkViews-project
Click to show the picture

project structure

First page of the Wizard for extforlkup
  • 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 for extforlkup

  • 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 for extforlkup

  • On the third page of the Wizard
    • select the View for which we need to generate the script
      • in our case we have selected PhbkDivisionView-View
Click to show the picture

project structure

Fourth page of the Wizard for extforlkup

  • On the Fourth page of the Wizard select 01005-.extforlkup.interface.cs-script type and click Next-button
Click to show the picture

project structure

Fifth page of the Wizard for extforlkup

  • On the Fifth page of the Wizard select extforlkup.interface.cs.t4-script and click Next-button
Click to show the picture

project structure

Sixth page of the Wizard for extforlkup

  • On the Sixth page of the Wizard click Save-button
Click to show the picture

project structure

A new phbk-division-view.extforlkup.interface.cs-file will be created.

01010 extforlkup class for PhbkDivisionView

A new phbk-division-view.extforlkup.cs-file will be created.

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