Skip to content

Latest commit

 

History

History
87 lines (60 loc) · 2.88 KB

configuration.rst

File metadata and controls

87 lines (60 loc) · 2.88 KB

Configuration

Getting Started

The VersaTul Configuration project enables the ability to get the values of the specified keys stored in the settings dictionary. Much like the DOTNET IConfiguration interface this configuration project provides a way to cleanly pass settings into an application. The VersaTul projects that needs settings are built on top of Configuration. However this project can be extended to be used in other custom projects as well.

Installation

To use VersaTul Configuration, first install it using nuget:

PM> NuGet\Install-Package VersaTul.Configuration -Version latest

Main Components

  1. IConfiguration : Represents a configuration file that is applicable to a particular application, or resource.
  2. IAppConfiguration : Represents the base application configuration.
  3. Configuration : Abstract class implementing IConfiguration. This class must be inherited.
  4. AppConfiguration : Abstract class implementing IAppConfiguration. This class must be inherited.
  5. ConfigSettings : Represents a collection of Key Values. Keys are strings and Values are object.

Functional Summary

  1. T IConfiguration.Get<T>(string name = null) : Gets the value of the specified key stored in the settings dictionary. Note: If no name is supplied the calling property name is used for the setting lookup.
  2. T IConfiguration.GetOrDefault<T>(string name = null) : Get the value of the specified key stored in the settings dictionary. However, if the key is not present then the default of the type T is returned.

Code Examples

Changelog

V1.0.10

  • Minor fixes
  • Dependent package updates

V1.0.9

  • Base Implementation Refactoring
  • Default key support

V1.0.8

  • Code ported to dotnet core
  • Documentation completed