Skip to content

Latest commit

 

History

History
executable file
·
30 lines (19 loc) · 686 Bytes

readme.textile

File metadata and controls

executable file
·
30 lines (19 loc) · 686 Bytes

Config

Allows strongly typed configuration and validation of data using Castle’s Windsor

Example

public class Example
{
    [ValidateRange(0, 11)]
    public int LevelOfAwesome { get; set; }

    [ValidateLength(0, 50)]
    public string HowAwesome { get; set; }
    
    public bool IsAwesome { get; set; }
}

var container = new WindsorContainer();

container.Install(new ConfigurationInstaller());
container.RegisterConfigurationEntity<Example>();

var example = container.Resolve<Example>();

if(example.IsAwesome)
    Console.WriteLine("This is {0} awesome. Its level {1} awesome", example.HowAwesome, example.LevelOfAwesome);