037 Classes used for interservice communication for Lookup Resource of PhbkDivision - chempkovsky/CS82ANGULAR GitHub Wiki
- 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 thelookup 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. WithJavaSripts
-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 fileJavaSripts
-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.
- 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
- so our next goal is to define classes and interfaces that describe the structures to be send to the
- This means that information about changing any row of
- To run
01005-.extforlkup.interface.cs
-script- Run Visual Studio and Open “PhonebookSolution” solution
- Right Click “PhBk” of the
LpPhBkViews
-project and selectJavaSripts Wizard
-menu item to open the Wizard dialog-
Note:
LpPhBkViews
-project is used instead ofPhBkViews
-project
-
Note:
Click to show the picture
- 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
- 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
- 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
- in our case we have selected
- select the View for which we need to generate the script
Click to show the picture
- On the Fourth page of the Wizard select
01005-.extforlkup.interface.cs
-script type and clickNext
-button
Click to show the picture
- On the Fifth page of the Wizard select
extforlkup.interface.cs.t4
-script and clickNext
-button
Click to show the picture
- On the Sixth page of the Wizard click
Save
-button
Click to show the picture
A new phbk-division-view.extforlkup.interface.cs
-file will be created.
-
To run
01010-.extforlkup.cs
-script repeat the steps -
On the Fourth page of the Wizard select
01010-.extforlkup.cs
-script type and clickNext
-button -
On the Fifth page of the Wizard select
extforlkup.cs.t4
-script and clickNext
-button -
On the Sixth page of the Wizard click
Save
-button
A new phbk-division-view.extforlkup.cs
-file will be created.