Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created June 17, 2016 06:02
Show Gist options
  • Save justinyoo/d398c32bd8e2c8582b67997c1bd923b2 to your computer and use it in GitHub Desktop.
Save justinyoo/d398c32bd8e2c8582b67997c1bd923b2 to your computer and use it in GitHub Desktop.
Configuration Value Converter for enum and List<T>
public class ProductElement : ConfigurationElement
{
[ConfigurationProperty("status", IsRequired = true)]
[TypeConverter(typeof(CaseInsensitiveEnumConverter<ProductStatus>))]
public ProductStatus Status
{
get { return (ProductStatus)this["status"]; }
set { this["status"] = value; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment