This project is read-only.

Project Description

Strongly typed configuration provider for .net applications.


- Remove hard-coded literals, while working with configuration settings for your project
- Remove hand-made conversion from string to meaningful type
- Provide centralized behavior for non-existing configuration values
- Provide unified way to access configuration properties located across different sources (text file, web config or database)


Available via NuGet:

Usage scenario

Config file
<?xml version="1.0" encoding="utf-8" ?>
    <add key="FooCount" value="98"/>
using NUnit.Framework;
using Typed.Configuration.ConfigSource;

namespace Typed.Configuration.Tests
    public class ConfigServiceUsage
        // Define interface with configuration properties
        public interface IConfigInterface
            int? ItemsPerPage { get; }
            int? NotExistingField { get; }

        public void FullUsageScenarioForStubSource()
            var configurationServiceBuilder = new ConfigurationServiceBuilder();

            // Register configuration interface within service
            configurationServiceBuilder.RegisterConfigInterface<IConfigInterface>(new AppSettingsSource(), new NullValueSource());

            // Create service instance and put it to your IoC container, or store in static vairable
            ConfigurationService configService = configurationServiceBuilder.Build();

            // Get configuration property value
            int? itemsPerPageCount = configService.For<IConfigInterface>().ItemsPerPage;
            Assert.AreEqual(98, itemsPerPageCount);
            int? notExistingValue = configService.For<IConfigInterface>().NotExistingField;


Currently supported property types:
- Int?
- Int[]
- String
- String[]

Last edited May 10, 2011 at 9:46 PM by valera_kolupaev, version 10