89 lines
5.4 KiB
Markdown
89 lines
5.4 KiB
Markdown
# Steps to Add New WorkItem to Existing Setup Api
|
|
1. Add new ActionType
|
|
<br />a. Location: LCU.Library.Internal.DispatcherModels Library --> Enums namespace --> ActionType.cs class
|
|
<br />b. Should add number the enum correlates to and to make sure to use the next number inline.
|
|
2. Update the API's Nuget version in LCU.Api.Internal.DispatcherSharedLib Library.
|
|
<br />a. Right click on LCU.Api.Internal.DispatcherSharedLib Library and select Manage Nuget Packages.
|
|
<br />b. Find API which will be updated.
|
|
<br />c. Update
|
|
3. Add Configuration to API's Configuration Class
|
|
<br />a. Location: LCU.Api.Internal.DispatcherSharedLib Library --> Configurations namespace--> ..Configuration.cs class
|
|
<br />b. Add new Endpoint Property
|
|
<br />c. Add NotMapped Url Property
|
|
4. Add new Endpoint to API's Configuration to Appsettings.
|
|
5. Add new ActionService Build to switch.
|
|
<br />a. Location: LCU.Api.Internal.DispatcherSharedLib Library --> BuilderServices namespace --> ActionBuilderService.cs class --> BuildAction method
|
|
<br />b. Add to #region for API. Example #Region FileOperationsApi.
|
|
<br />c. Add new switch following the existing switch's pattern.
|
|
6. Add new unit test to the ActionBuildServiceTest.
|
|
7. Update Version/Description/PackageReleaseNotes LCU.Api.Internal.DispatcherSharedLib.
|
|
<br />a. Increase by 0.0.1 for new WorkItems.
|
|
8. Update Version/Description/PackageReleaseNotes LCU.Library.Internal.DispatcherModels.
|
|
<br />a. Increase by 0.0.1 for new ActionTypes.
|
|
9. Add new endpoint to Release Variables.
|
|
<br />a. Set variable to be release.
|
|
|
|
# Steps to Add New WorkItem to New API Setup
|
|
1. Add new ActionType
|
|
<br />a. Location: LCU.Library.Internal.DispatcherModels Library --> Enums namespace --> ActionType.cs class
|
|
<br />b. Should add number the enum correlates to and to make sure to use the next number inline.
|
|
2. Install the new API's Nuget version in LCU.Api.Internal.DispatcherSharedLib Library.
|
|
<br />a. Right click on LCU.Api.Internal.DispatcherSharedLib Library and select Manage Nuget Packages.
|
|
<br />b. Find API which will be installed.
|
|
<br />c. install
|
|
3. Create new Configurations class for new API
|
|
<br />a. Location: LCU.Api.Internal.DispatcherSharedLib Library --> Configurations namespace--> ..Configuration.cs class
|
|
<br />b. Add URL Property
|
|
<br />c. Add New Endpoint Property
|
|
<br />d. Add NotMapped URL Property that will be URL + Endpoint. Follow already existing Configration classes as example.
|
|
4. Add new Endpoint to API's Configuration to Appsettings.
|
|
5. Bind New Configration Model in DependencyInjection.cs
|
|
<br />a. Location: LCU.Api.Internal.DispatcherSharedLib --> DependencyInjection.cs
|
|
6. Add new ActionService Build to switch.
|
|
<br />a. Location: LCU.Api.Internal.DispatcherSharedLib Library --> BuilderServices namespace --> ActionBuilderService.cs class --> BuildAction method
|
|
<br />b. Pull in new Configration class.
|
|
<br />c. Create new #region for API. Use #Region FileOperationsApi as an example.
|
|
<br />d. Add new switch following the existing switch's pattern.
|
|
7. Add new Region for Api and new unit test to the ActionBuildServiceTest.
|
|
8. Update Version/Description/PackageReleaseNotes LCU.Api.Internal.DispatcherSharedLib.
|
|
<br />a. Increase by 0.0.1 for new WorkItems.
|
|
9. Update Version/Description/PackageReleaseNotes LCU.Library.Internal.DispatcherModels. Increase by 0.0.1 for new ActionTypes.
|
|
<br />a. Increase by 0.0.1 for new ActionTypes.
|
|
10. Add new URL and new endpoint to Release Variables.
|
|
<br />a. Set variable to be release.
|
|
<br />b. Set each URL appropriately for each environment
|
|
|
|
Notes:
|
|
- Only HttpMethodType.Post is set up to be used.
|
|
- The model being added needs to have extend the ReturnResponse model
|
|
- Will need to add the QueueReturnResponse.QueueResponse([Model]) to the API upon completion.
|
|
|
|
#Filter and Sorting
|
|
Filtering and sorting are handled by creating IQueryable and IEnumarable classes/methods. IQueryable is the preferred route as it will utilize the power of the database querying rather than filtering/sorting after the data has been gathered. Only use IEnumarable if it is more complicated to write the linq statement then already written C# code.
|
|
|
|
Once a Filter Property and a IQueryable/IEnumarable class/method are created you will just need to append in the desired entities repository method in which is being filtered.
|
|
|
|
Adding Filtering Steps:
|
|
1. Add new property to Filter model. Use another model if needed more information.
|
|
2. Create IQueryable/IEnumarable classes/methods in the proper namespaces.
|
|
3. Append new method to your context query call or after if using an IEnumarable.
|
|
4. Test
|
|
|
|
Adding Sorting Steps:
|
|
1. Add string constant
|
|
2. Add string constant to list of constants.
|
|
|
|
# Steps to setup local database
|
|
1. Download and install Sql Server 2022 Developer edition
|
|
2. Right click the LCU.Api.Internal.DispatcherSql project and select the Publish option
|
|
3. Click Edit in the Target Database Connection Settings. Use the following settings:
|
|
Server Name: localhost
|
|
Authentication: Windows Authentication
|
|
User Name: LCU\YOUR NAME (This should already be populated)
|
|
Password:
|
|
Database Name: master
|
|
5. Test connection and ensure it was successful. Click Ok. The target database connection will now be populated.
|
|
6. Enter Dispatcher for Database Name
|
|
7. Enter LCU.Api.Internal.DispatcherSql.sql for Publish Script Name
|
|
8. Click Publish. You now have a local sql server setup with the dispatcher database.
|
|
9. You can download and install sql management studio to view database locally. |