How To: Add Profiles to the Ed-Fi ODS / API Solution
This example outlines the steps necessary to integrate and activate Ed-Fi Profile definitions for use in an Ed-Fi ODS / API. It is assumed that the Ed-Fi ODS / API has been successfully set up and is running in a local environment per the instructions in the Getting Started documentation.
The steps in Visual Studio can be summarized as:
Detail on each step follows.
Step 1. Create the Profiles Project
Create the Visual Studio Project
Add a Profiles Project Using the Visual Studio Project Template. Visual Studio Project Template can be installed by following steps in Project Templates Installation section of this documentation.
Step 2. Integrate Profiles into the Solution
To integrate the Profiles into the solution, add a reference to the Profiles project you constructed in the previous step in the EdFi.Ods.WebApi project (located in the "Entry Points" folder).
Step 3. Run Code Generation and Verify Changes
Save all modified files, close the Ed-Fi-ODS Visual Studio Solution, then re-run the code generation steps outlined in the Getting Started Guide (i.e., from a PowerShell prompt run Initialize-PowershellForDevelopment.ps script followed by the initdev command). Then run the application and view the Ed-Fi ODS / API using Swagger.
The new Profile should be visible:
You may have to clear your browser cache in order for Swagger UI to display the new resource.
Profiles in Use
This section covers additional information and settings useful after development is complete.
Confirming Profile Settings
Profile settings are flexible. With this flexibility comes some complexity — so platform hosts will want to confirm that the deployed API Profiles behave as expected, exposing exactly the right resources. This can be done manually or using an SDK created by code generation techniques.
Adding Profiles to the API Administration Database
The EdFi_Admin database stores the data required to manage API keys and secrets, as well as Education Organization and Profile assignments. When the API is initialized, the names of the Profiles that have been configured into the API will be published to the Profiles table. This process performs a one-way publishing and will not remove existing Profile names that are no longer contained within the API configuration.
The EdFi_Admin tables related to this process are shown below.
The following GitHub link contains source files for this Profile sample: