Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In this example, we will create an extension plugin and publish it to NuGet feed, which can then be placed in the plugin folder of a pre-deployed ODS / API to extend it.

Before you begin:

The steps can be summarized as:

Table of Contents
maxLevel3

Each step is outlined in detail, below. 

Creating Extension Plugins

Step 1. Run CodeGen

Info

This step is optional. If you have followed through How To: Extend the Ed-Fi ODS / API - Alternative Education Program Example and have run initdev, code generation is already completed. 

After creating your extension project by following the example on How To: Extend the Ed-Fi ODS / API - Alternative Education Program Example,

Open a PowerShell session and navigate to Ed-Fi-ODS-Implementation folder and execute the following command to run code generation.

cd <source directory>\Ed-Fi-ODS-Implementation
.\Initialize-PowershellForDevelopment.ps1
Invoke-CodeGen -Engine SQLServer

Image Removed

-StandardVersion 5.1.0 -ExtensionVersion 1.0.0

Image Added

Step 2. Build Your Extension Project 

From a PowerShell session, run the following command to build your extension project. If you followed the example on How To: Extend the Ed-Fi ODS / API - Alternative Education Program Example to create the EdFi.Ods.Extensions.SampleStudentTransportation project, your extension will be in Ed-Fi-ODS-Implementation\Application folder.

dotnet build <source directory>\Ed-Fi-ODS-Implementation\Application\EdFi.Ods.Extensions.SampleStudentTransportation SampleAlternativeEducationProgram --configuration release 

Image RemovedImage Added

Step 3. Create a NuGet Package 

Go to the location of NuGet.exe in your system and execute the following command in a command prompt. Make sure to update the contents of the nuspec file with your information. It is recommended that you version your extension package with the same version as the ODS / API for which it was built. 


Code Block
languagepowershell
cd tools
.\NuGet.exe pack <source directory>\Ed-Fi-ODS-Implementation\Application\EdFi.Ods.Extensions.SampleStudentTransportationSampleAlternativeEducationProgram\EdFi.Ods.Extensions.SampleStudentTransportationSampleAlternativeEducationProgram.nuspec -OutputDirectory <output directory> -Properties configuration=release -Properties standardversionStandardVersion=5.1.0 -Properties extensionversionExtensionVersion=1.0.0 -NoPackageAnalysis -NoDefaultExcludes

Image RemovedImage Added


Image RemovedImage Added

Step 4. Publish NuGet Package

In this step, execute the following command to publish NuGet package.

Code Block
.\NuGet.exe push -source https://pkgs.dev.azure.com/ed-fi-alliance/Ed-Fi-Alliance-OSS/_packaging/EdFi/nuget/v3/index.json -apikey <PAT> <nuget directory>\EdFi.Ods.Extensions.SampleStudentTransportationSampleAlternativeEducationProgram.1.0.0.Standard.5.1.0.1.0.0.nupkg

Image RemovedImage Added

Consuming Extension Plugins

Follow the approach described in How To: Deploy an Extension Plugin to consume the published extension package.