LogoLogo
HomePricingDocumentation
  • 💿Getting Started
    • Installation and Project Setup
    • Hello Perigee!
    • Perigee Application Design
    • Hello Configuration
    • Hello Logs
    • Hello Integration
    • Troubleshooting
    • Case Studies
  • 📃License + Notice
    • 📂Licensing
    • Notice of Third Party Agreements
  • 🚀Perigee and Beyond
    • Extending - Threads
    • Extending - Loaders
    • ⏳All about CRON
  • 🔮API Generation
    • What is API Generation?
    • API Builder
  • 🗺️Architecting YOUR App
    • Design and Requirements
    • Define Sources
    • Requirements
  • 🧩Core Modules
    • 🌐PerigeeApplication
    • 🪡Thread Registry
    • Event Sources
      • Scheduled/Logic
        • CRON Thread
        • Scheduler
        • Sync Agent
      • Watchers
        • SalesForce
        • Sharepoint
        • Directory Watch
        • Directory Notifier
        • IMAP
    • Credential Management
      • Connection Strings
      • Custom Refresh Logic
      • RestSharp Authenticator
      • Credential Store SDK
      • ⁉️Troubleshooting Credentials
    • Integration Utilities
      • HTTP(S) - RestSharp
      • Transaction Coordinator
      • Limiter
      • Watermarking
    • Alert Managers
      • SMS
      • Email
      • Discord
      • Teams
    • File Formats
      • Excel
      • CSV
    • 📁File System Storage
      • File Revision Store
      • Concurrent File Store
      • FileSync + Cache
    • Third Party
      • SmartSheets
      • Microsoft Graph
    • Perigee In Parallel
      • Parallel Processing Reference
      • Extensions
      • GroupProcessor
      • SingleProcessor
    • 🧱Utility Classes
      • Metrics
      • F(x) Expressions
      • Multi-Threaded Processor (Scatter Gather)
      • OpenAI - GPT
      • XML Converter
      • Dynamic Data Table
      • Debounce
      • Thread Conditions
      • Perigee Utility Class
      • Network Utility
      • Lists
      • FileUtil
      • Inclusive2DRange
      • Strings, Numbers, Dates
      • Nested Sets
      • Behavior Trees
      • JsonCompress
      • Topological Sorting
      • DBDownloader
    • 🈁Bit Serializer
  • 📣Examples and Demos
    • API + Perigee
    • 📰Excel Quick Load
    • SalesForce Watcher
    • Report Scheduler
    • Agent Data Synchronization
    • 📩IMAP Echo bot
    • Watch and load CSVs
    • Graph Delegated Authorization + DataVerse
    • Coordinator Demo
    • Azure Service Bus
    • QuickBooks Online
  • 📘Blueprints
    • Perigee With .NET Hosting
    • Web Host Utilities
    • 🔌Plugin Load Context
  • 🎞️Transforms
    • 🌟What is Transforms?
    • 📘Terminology
    • 🦾The Mapping Document
    • 👾Transformation Process
    • 😎Profile
    • 🎒Automation
      • 🕓Package Options
      • 🔳Configuration
    • 🔧Utilities
      • 🧹Clean
      • 📑Map File
      • 🔎File Identification
      • 🗺️Map Generation
      • 🪅Insert Statement Generation
  • 🗃️Transform SDK
    • 👋Quick Start Guide
    • 🥳MapTo
    • 🔌Authoring Plugins
      • 🔘File IO Process
      • 📢Data Quality
      • 🟢Transform Process
    • SDK Reference
      • 🔘FileIOProcessData
      • 📢DataQualityContext
      • 🎛️TransformDataContext
      • 🏅TransformResult
Powered by GitBook
On this page
  • Custom Implementation
  • Using the built in SQL Provider
Export as PDF
  1. Perigee and Beyond

Extending - Loaders

It's very easy to add custom providers.

PreviousExtending - ThreadsNextAll about CRON

Last updated 17 days ago

It's very easy to add custom providers. Remember that .NET creates a ConfigurationSource that implements and returns a ConfigurationProvider.

You can see this pattern here: .

Custom Implementation

To implement a custom source and provider only requires a single line of code.

  1. Call the ConfigureConfiguration method.

  2. This callback sends you two parameters:

    1. IConfigurationBuilder This builder allows you to add a custom source.

    2. EnivronmentString the string variable that is the current environment.

  3. Simply add a new instance of the source. (See line 5)

PerigeeApplication.ApplicationNoInit("DemoApp", (c) => {
    
    //Add ConfigurationSource to the builder
    c.ConfigureConfiguration((builder, EnvStr) => {
        builder.Add(new SQLConfigurationSource("connectionString", "select [name], [value] from dbo.configs", "sql"));
    });

    //Reload all providers
    c.ReloadProviders();

    //Reload the specific provider
    c.ReloadProvidersOfType(typeof(SQLConfigurationProvider));
    
    string MyValueFromSQL = c.GetValue<string>("sql:MyValue");
    
});

You can see how easy it is in the future to reload the providers. You can reload all of them or specific types by supplying that type information.

Using the built in SQL Provider

If you're trying to load values from a SQL database, then Perigee ships with a loader ready to go in only a single line of code. Simply call the configuration method and supply the connection, query, and prefix.

Because this works with IDBConnection, it works with MSSQL, PostGres, MySql... etc. Just supply the appropriate connection and it will work!

PerigeeApplication.ApplicationNoInit("DemoApp", (c) => {

    //Configure the SQL Property loader using SqlConnection
    c.ConfigureSqlPropertyLoader(
        () => new SqlConnection(c.GetConnectionString("main")),
        "SELECT [Key],[Value] FROM [dbo].[PropertyStore]");

    string MyValueFromSQL = c.GetValue<string>("sql:MyValue");
    
});
Implement a custom configuration provider
🚀
Page cover image